Hi I have a problem where i have to perform similar steps / actions (which differ slightly) on different sets of data (the data can be slightly different also with regards to its strucure). There are a few steps that i need to perform: connect, validate, build error messages if required, change the strcture of the data in to a set forma...
So, I'm reading through the YUI best practices for speeding up your web page, and I'm using PHP to try and implement some of those suggestions. Here is what I have so far:
<?php
// Expires one year from now
$expires = mktime(0, 0, 0, date("m"), date("d"), date("Y")+1);
// Format date
$date = date('D, d M Y H:i:s', $expires);
// Se...
I know that I can display time for a particular location using only JavaScript (and no web service or external data source), but...
I want to avoid using this solution because I don't want to have to account for daylight savings time, and any other factors that make it complicated.
I'm looking for an easier way to display the time and a...
Hello fellows,
When I try to upload a file on my localhost version of the website it gives me the following message:
"The upload destination folder does not appear to be writable"
The upload functionality is working perfectly on production server.
I checked the permissions of the destination folder about million times still getting th...
I want to programmatically check if a site has feeds. How can I do that?
Are there standard feed locations?
Parsing the code for link tags with application/rss+xml attribute would be enough?
Thank you.
...
I've been working on a PHProxy server for some time (you can see my recent posts) and I'm at a point where I have everything working except this problem.
do
{
$data = @fread($_socket, 8192);
$_response_body .= $data;
}
while (isset($data{0}));
unset($data);
My proxy server logs into a server running IIS without the user's i...
Hello,
I am dividing 19/5 where by I have used 19/5 but I am unable to get the remainder only.
How do I get it.
Thanks
Jean
...
On a webserver, I have a php script that parses a .sql file (which is stored directly on the server), and executes the queries on a mysql database. I have a lot of french characters that doesn't insert well: é becomes é.
When I open the sql file with notepad++, I see that the encoding is "uft-8 without BOM".
My script looks like thi...
Hi,
I want to programmatically detect flash on a web page.
From my search, I understand I need to parse the code and look for embed tags that have the attribute "application/x-shockwave-flash".
Is that all? Or there are other ways to embed flash into a web page?
Thank you.
...
Hi Everyone, I'm currently using nginx as a transparent proxy for apache. I would like to use nginx + fcgi(php) but need mod-rewrite support.
Is this possible or is there an alternative solution to my woes?
This is for only 1 site, would litespeed be an effective solution?
...
Hi all,
I'm having problems with killing parent process that have 1 child - parent is waiting for child to exit and only after that kill handler is called. When the kill handler is not installed (pcntl_signal(SIGTERM, "kill_handler")) script terminates immediately.
I need that after submitting kill command to terminate parent process ...
In my PHP script, I'm using XPATH to search nodes for text. Everything works swimmingly -except - when I search for a word with an apostrophe.
basically my code looks like this
$keyword = $_GET['keyword'];
...snip...
$xml = simplexml_load_file($data);
$search = strtolower($keyword);
$upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$lower =...
There is a mistake in this code, I could not find it. What is the missing character do I need?
preg_replace(/<(?!\/?(?:'.implode('|',$white).'))[^\s>]+(?:\s(?:(["''])(?:\\\1|[^\1])*?\1|[^>])*)?>/','',$html);
...
I'm trying to define my PHP __autoload function to be as bulletproof and flexible as possible.
Here's the breakdown of my application's structure:
/dev (root)
/my_app
/php
/classes
- Class1.php
- Class2.php
- Class3.php
/scripts
myscript.php (th...
I was wondering if my code below is even correct, I've been having numerous errors with this, but am not sure if the problem really exists here. The code is below:
The user will click 'Exit Group'.
<p class="logout"><a id="exit" name="logout" href="#">Exit Group</a></p>
The code that should be execute when 'Exit Group' is clicked is ...
Hey all,
I'm looking for any resources on choosing "good" colors based on one specified color. Specifically if I gave an input of say... #6e93a8, a nice corporate blue, it could spit out a darker blue for a border color and perhaps a white or black for text based on how dark the given color is. Keep in mind I can input any hex value.
I...
Like most users, I'm simply trying to figure out a secure way to store passwords. What I haven't found here (or maybe it's my lack of understanding) is how to retrieve a salted hash in my database and separate the salt from the hashed password, especially with unique salts to each password while maintaining the salt+password in a single ...
Hello,
I want to use profile URLs on my site such as xyz.com/username
I am using the follow code:
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?p=profile&u=$1 [L,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?p=profile&u=$1 [L,QSA]
My question is...
How can I use it like this, and keep the access to other links such as xyz.com/forums,...
I have been tasked by a client to rebuild an E-Commerce platform. The goal is an online shop on which vehicles are sold. The specialty is that it's supposed to be multi-supplier capable, i.e. external suppliers will have their own login back-end where they can manage their listings, add new ones, view their sales, etc.
The shop shows a...
i have a script (php+html) full of forms and inputs, after the form is submited via post i can give the user a code (like was a GET form) q=test&t=3&u=9&q2=test&t2=3&u2=9&q3=test&t3=3&3u=9, then the user can put this code in a textarea for editing what he previously submitted
how to transform the code inputed in the textarea (q&t&u) to ...