PHP and printing out whitespace?
I was wondering how can I print out whitespace in the following code below. <?php echo "$first_name", "$last_name" ; ?> ...
I was wondering how can I print out whitespace in the following code below. <?php echo "$first_name", "$last_name" ; ?> ...
We are running Drupal 5.x on Nginx with php-fastcgi. Things were working fine for a while. All of a sudden, we (users) are running into 502 Bad Gateway error. Restarting PHP-cgi, nginx.. rebooting machine etc did not help. Did anyone else run into this type of issue? What are the possible suspects? ...
Hello all, I have a bunch of videos stored on my Amazon S3 storage. I'm working on creating a PHP script, very similar to the one here, where users can download the videos to their hard drive. I'd like to use something like this: <?php $file_name = $_GET['file']; $file_url = 'http://www.myamazons3.com/' . $file_name; header('Content...
Is php compiled or interpreted? ...
Hey I am currently showing results using the following url index.php?id=1 and using .htaccess to rewrite it like cat/sub-cat/ and i am using pagination and the url to the next page is index.php?page=2 etc but i can't seem to get the pagination to work with my .htaccess rewritten url so for example threads/thread-name/ shows the page fin...
I am creating a session and I want a variable to be available for the entire site, so for example: Joe Soap lands on a page called red-widgets.php, - Joe's session variable is let's say 'red-widgets'. Joe then clicks on another page called blue-widgets.php. I would like the session variable to be still the original 'red-widgets'. How c...
How can I print the array in a Tree-like format--making it easier to read? ...
Here is the suject: http://www.mysite.com/files/get/937IPiztQG/the-blah-blah-text-i-dont-need.mov What I need using regex is only the bit before the last / (including that last / too) Now this 937IPiztQG bit can change, it has a-z A-Z 0-9 - _ Heres the code i wrote but it doesnt work $code = strstr($url, '/http:\/\/www\.mysite\.com\...
Can I shorten this function? $mins = $secs - time('u'); function minutes($seconds){ return sprintf( "%2.2dm %2.2ds", floor($seconds/60),$seconds%60);} $mins_left = minutes($mins); echo "Resets in $mins_left."; ...
Hello again. I have the following code: $array = parse_url($_SERVER['HTTP_REFERER']); $Ur = $array['host']; which displays the domain just fine, but when I use this with sessions, it doesn't work. Also, I tested it with gettype and it returns Null? I thought it was an array? Anywho, how do I go about converting the above $Ur into a...
I had an inefficient piece of code for resetting passwords based on a user entering either their username or their email address. The PHP script branched depending on the identifier used. I collapsed it into one which now works if the user enters their username but not if they enter their email address. Here is the salient code: $identi...
I need to upload a file to my webserver from a C# program. The problem is, I need to also POST two strings at the same time. So far, I have: HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create("http://localhost/test.php"); ASCIIEncoding encoding = new ASCIIEncoding(); string postD...
I want to join a String[] with a glue string. Is there a function for this? ...
hi to all I have a php function, in this function I have a javascript which get the value of my element from parent window. My problem now is, how can I pass this value into php variables Any help would greatly appreciated. Thanks Tirso I tried this code but I got value always 1 here is my code function do_upload() { $categories...
I have a php upload handler in upload.php, and there, I have to following <? setcookie("test",100,time()+3600); ?> but, when I check the cookies that are set, I dont see any "test" cookie at all. Can you please help me set a cookie on file upload? why is this upload script any different from any normal script that is accessed by the ...
As you will see I am fetching the column, and trying to update column with new data. $result2 line is my problem, I don't think I can add $row[0] in there. How do I do it? $result = mysql_query("SELECT link FROM items LIMIT 3"); while($row = mysql_fetch_array($result)) { $url=($row[0]); $rez2 = get_final_url($url); $result2...
Hi, I'm pretty new to WordPress but have spent some 50 odd hours studying up on it, trying things out and such and have the feeling I got a pretty good handle on it now.. However the one thing I simply cannot get working is to have a page spit out a list of posts of a certain category. Here is my example: http://dev.jannisgundermann.c...
Hi guys, I'm running a sql query to get basic details from a number of tables. Sorted by the last update date field. Its terribly tricky and I'm thinking if there is an alternate to using the UNION clause instead...I'm working in PHP MYSQL. Actually I have a few tables containing news, articles, photos, events etc and need to collect al...
I am filtering null values, in php on MYSQL. When a null value is read, I need the MySQL to read the next record. How do I go about doing that? ...
Hi all, i have an simple array: array 0 => string 'Kum' (length=3) 1 => string 'Kumpel' (length=6) when I encode the array using json_encode(), i get following: ["Kum","Kumpel"] My question is, what is the reason to get ["Kum","Kumpel"] instead of { "0" : "Kum", "1" : "Kumpel" }? ...