[PHP] strange problem of mysql_query
hey, i have a sql string like below: select szs_content from szs_gy_ca where szs_shengchanhao='09-s525' and szs_guige='48B32/14-1 1/8' and szs_tuhao='48B32 1 1/8' the problem is that using mysql_query to run this sql string returns nothing,however, i can get one record through mysql query tool. i was wondering whether the double quote 48B32/14-1 1/8 makes this trouble.
Re: [PHP] strange problem of mysql_query
On Wed, 2010-06-02 at 17:36 +0800, I am on the top of the world! Borlange University wrote: hey, i have a sql string like below: select szs_content from szs_gy_ca where szs_shengchanhao='09-s525' and szs_guige='48B32/14-1 1/8' and szs_tuhao='48B32 1 1/8' the problem is that using mysql_query to run this sql string returns nothing,however, i can get one record through mysql query tool. i was wondering whether the double quote 48B32/14-1 1/8 makes this trouble. The double quotes inside of that query won't cause any trouble, but you haven't shown us how you're executing the query with PHP. The usual is to do something like this: $query = select szs_content from szs_gy_ca where szs_shengchanhao='09-s525' and szs_guige='48B32/14-1 1/8\' and szs_tuhao='48B32 1 1/8'; $result = mysql_query($query); Note that the double quote there is escaped because you're already using double quotes as the string identifier in PHP. If that still doesn't give you the results you expect, it's more likely a logic problem than a syntax issue. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] strange problem of mysql_query
I am on the top of the world! Borlange University wrote: hey, i have a sql string like below: select szs_content from szs_gy_ca where szs_shengchanhao='09-s525' and szs_guige='48B32/14-1 1/8' and szs_tuhao='48B32 1 1/8' the problem is that using mysql_query to run this sql string returns nothing,however, i can get one record through mysql query tool. i was wondering whether the double quote 48B32/14-1 1/8 makes this trouble. Break it down the basic of examples. show us how you... 1. connect to mysql from php 2. select your database in mysql from php 3. prepare the SQL query 4. executing said query 5. collecting/displaying the results of executed query As you can see, you gave us step 3. The problem could be in any of the other setups. -- Jim Lucas A: Maybe because some people are too annoyed by top-posting. Q: Why do I not get an answer to my question(s)? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem with count()
At 1:27 PM +0100 10/29/06, Gunnar Beushausen wrote: Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: -snip- Gunnar: I find it wise to check out all the built-in array functions before starting to write something myself -- there are a lot of them including what you just tried to write. Also, in your code you pushed $this-result and then were surprised when count($this-result) gave you a value of 1 -- just how many $this-result's were you thinking you pushed? You're not using count() correctly. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem with count()
Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: if(!$this-done) { array_push($this-result, $this-stmt-fetchall_assoc()); } $this-done = true; $this-currIndex = $this-rowIndex = count($this-result)-1; return $this; If i do a print_r($this-result); i'm getting like thousand entries, so the array is actually filled with all values needed. But somehow a count($this-result) gives me a value of 1. I wonder why count says there is only 1 entry in that array, when print_r gives out more than thousand entries. Does anybody have a clue? I'm using php 5.1.6 Thanks in advance, Gunnar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem with count()
Side note, it sounds like $this-result is an object holding an array, not the array itself and print_r is automatically traversing the object. On Oct 29, 2006, at 4:27 AM, Gunnar Beushausen wrote: Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: if(!$this-done) { array_push($this-result, $this-stmt-fetchall_assoc()); } $this-done = true; $this-currIndex = $this-rowIndex = count($this-result)-1; return $this; If i do a print_r($this-result); i'm getting like thousand entries, so the array is actually filled with all values needed. But somehow a count($this-result) gives me a value of 1. I wonder why count says there is only 1 entry in that array, when print_r gives out more than thousand entries. Does anybody have a clue? I'm using php 5.1.6 Thanks in advance, Gunnar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem with count()
On Sun, October 29, 2006 6:27 am, Gunnar Beushausen wrote: I've a strange problem with count. I wrote a routine to jump to the last position of an array. You mean kind of like this one? http://php.net/end :-) I also suspect you are not doing count() on the right thing... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem after getting data from the DB
Hi, I dont know if this is a bug or something but I am getting some strange results from what should be a simple program; I have a bunch of movie titles in my database, this is the structure: part_url part_size part_format bandwidth_type flick_name and the above table contains data like this: domain.com/part1.mpg,144mb,MPG,LOW,Spiderman domain.com/part2.mpg,104mb,MPG,LOW,Spiderman domain.com/part3.mpg,110mb,MPG,LOW,Spiderman etc In my script I run this SQL: select * from table order by flick_name $num_rows = mysql_num_rows($q); then a little below: $flick=array(); for($i=0; $i $num_rows; $i++) { $row = mysql_fetch_row($q); $flick_name = $row[5]; $part_url = $row[0]; $part_size = $row[1]; $time_length = $row[2]; $part_format = $row[3]; $bw_type = $row[4]; $flick[$row[5]][] = array (part_url = $row['0'], part_size = $row[1], time_length = $row[2],part_format = $row[3],bw_type = $row[4]); } - Which basically gets all the records nicely under the flicks name, then I format the data onto my page like this: Flick name --- Part1.mpg - 144mb - MPG - LOW Part2.mpg - 104mb - MPG - LOW Part3.mpg - 110mb - MPG - LOW So far so good, but heres where i am getting some strange results, there is a movie called Try A Teen and for some reason this movie is split like this Try A Teen --- Part1.mpg - 144mb - MPG - LOW Part2.mpg - 104mb - MPG - LOW Part3.mpg - 110mb - MPG - LOW Try A Teen --- Part4.mpg - 144mb - MPG - LOW Part5.mpg - 104mb - MPG - LOW Part6.mpg - 110mb - MPG - LOW After a lot of searching through the page source I see that the first Try A Teen has a line break (after the n in teen whatevers there appears on the next line), thats why it seems different...but when I went into the mySql db via phpmyadmin...there is no linebreak to be found anywhereand all the other titles are working perfectly fine... what do you think is the problem? Bug? Something with the script? MySql? If you want the script or the DB email me offlist and i'll send it to you. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange problem after getting data from the DB
[snip] After a lot of searching through the page source I see that the first Try A Teen has a line break (after the n in teen whatevers there appears on the next line), thats why it seems different...but when I went into the mySql db via phpmyadmin...there is no linebreak to be found anywhereand all the other titles are working perfectly fine... what do you think is the problem? Bug? Something with the script? MySql? [/snip] Let's try an experiment, do a string replace to get rid of the newline and report back what happens. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with overlapping names
Hi all, the page shown below works fine on my own machine, but on another (remote) server, it gives me a strange result. Here's what happens: The first time I view the page it says array(0) { } as I'd expect, but on the second it says object(kurv)(0) { } where I expected another array. The problem seems to be that the object has the same name as the key in $_SESSION -- if I call it $foobar the problem disappears. But that explanation doesn't really make much sense to me. As I see it there's something wrong on the server. Can anybody tell me anything about this problem? Thanks, Niels ?php class kurv { function kurv() { if (!array_key_exists('kurv', $_SESSION)) {$_SESSION['kurv']=array();} } } session_start(); $kurv=new kurv(); var_dump($_SESSION['kurv']); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with overlapping names
the page shown below works fine on my own machine, but on another (remote) server, it gives me a strange result. Here's what happens: The first time I view the page it says array(0) { } as I'd expect, but on the second it says object(kurv)(0) { } where I expected another array. The problem seems to be that the object has the same name as the key in $_SESSION -- if I call it $foobar the problem disappears. But that explanation doesn't really make much sense to me. As I see it there's something wrong on the server. Can anybody tell me anything about this problem? Compare the output of phpinfo() on your machine with the output on the server. Look at any differences. BTW - the script works fine on my server. -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with overlapping names
On Friday 06 January 2006 21:26, Philip Hallstrom wrote: Compare the output of phpinfo() on your machine with the output on the server. Look at any differences. They look the same, more or less. Anything particular I should look for? The session sections are completely identical. BTW - the script works fine on my server. Thanks for checking. //Niels -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange Problem: session_set_save_handler
Hi, i´ve a strange Problem with the session_set_save_handler-Function. Firt of all my config: in my intranet i´m using 2 servers the first server is the db-server running mysql v. 12.22 dist 4.0.24 the second server is the webserver running apache2 Linux apache 2.6.5-7.147-smp running and is using php v. 4.3.4 i´ve written some function to store session-data in a table on the mysql-server. because of the fact that i´ll never see if the write-session-function is called i´ve placed a write-a-log-to-disk function in all session-function to see if they are called. when i use files in the /tmp-directory to store the session-data everything works fine, but if i switch to the db-based-system php crashes with no error message (crash in this case means that a empty page is transfered to the client). a sideeffect of this problem is the following: i use some wrapper-classes to handle database-insert/select and updates. if i use the file-based-session-handling i can select the content of the session-table, but when i use the db-based my wrapper class get a empty record-set when i try to select the table where the session-data is stored. using a programm like sqlyog i can see the entries written by my handler-functions. the realy strange thing is the following: till yesterday everything works fine (yes, also the db-based-handling). today i´ve rebootet the webserver. no config-files has been changed. after the computer has been booted the described problem occured. can anybody help me to fix this problem or give some hints where to find the error? thx for help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange Problem: session_set_save_handler
On Thu, July 7, 2005 4:14 am, Thorsten Friedrich said: because of the fact that i´ll never see if the write-session-function is called i´ve placed a write-a-log-to-disk function in all session-function to see if they are called. What are these write-a-log-to-disk functions outputting? Can you beef them up, particularly with error-checking on the result of you mysql_query() calls? If your queries are failing for some reason, and you're not logging it, and you're used to seeing them in your browser or Apache log, you'll never know unless you log them from here and check that other log. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with DB queries
On Mon, May 2, 2005 4:07 am, George Pitcher said: On page y, I've echoed the queries and they work fine when I paste them into MySQLCC. However, if I do print_r($row), I get an ampty array. Echoing the $result gives me Object id #3 (on page x this is Object id #6). I have another popup window which is used to build xml output etc and the queries (some using the same functions) seem to wortk there. How are you handling error conditions returned from MySQL? Checking mysql_error()? Ir not, try that first. If you are, and MySQL is giving different results for the same query, you must have some kind of pre-condition or other factor you are missing... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with DB queries
Hi, I am encountering a strange problem with a pop-up window. On my site, users (very specialised, closed site with small numbers) have to click a link on page x which pops up page y. Page x and y both contain pricing information based on a functions.php include file. On page x, the data is being displayed correctly. On page y, most of the data is not being displayed. On page y, I've echoed the queries and they work fine when I paste them into MySQLCC. However, if I do print_r($row), I get an ampty array. Echoing the $result gives me Object id #3 (on page x this is Object id #6). I have another popup window which is used to build xml output etc and the queries (some using the same functions) seem to wortk there. Any suggestions? George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange problem with DB queries - MORE
Sorry, I forgot to mention that I'm using PEAR::DB and Smarty, Server is WinNT running Apache 2.0.52, and PHP 5.0.2. MySQL 4.0.5-beta-max-nt is running on a separate server (NT also). All this is about 70 miles away and I haven't seen the servers for over 3 years (oh how wonderful remote access is!). Cheers -Original Message- From: George Pitcher [mailto:[EMAIL PROTECTED] Sent: 2 May 2005 12:07 pm To: php-general@lists.php.net Subject: [PHP] Strange problem with DB queries Hi, I am encountering a strange problem with a pop-up window. On my site, users (very specialised, closed site with small numbers) have to click a link on page x which pops up page y. Page x and y both contain pricing information based on a functions.php include file. On page x, the data is being displayed correctly. On page y, most of the data is not being displayed. On page y, I've echoed the queries and they work fine when I paste them into MySQLCC. However, if I do print_r($row), I get an ampty array. Echoing the $result gives me Object id #3 (on page x this is Object id #6). I have another popup window which is used to build xml output etc and the queries (some using the same functions) seem to wortk there. Any suggestions? George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with picture Upload
On Sat, April 23, 2005 7:44 am, Labunski said: Hi guys, I have to say, I've written so many scripts that had file upload functions included, but this time something strange is happening. The script passes the IMAGE_TYPE check, and picture's name stores in the database (so I guess the picture should have been stored in the dir.), but when I look at the ftp - there's no picture in the upload directory. I suspect your test for JPEG||GIF is messing up, and the file is getting deleted because of that. Try adding the line below and see what it does. Chmod of the directory is 777; Here it is: $realdir = $_SERVER['DOCUMENT_ROOT'].'/img/'; $uploadfile = $realdir. basename($_FILES['postbilde']['name']); if (move_uploaded_file($_FILES['postbilde']['tmp_name'], $uploadfile)) { $put_name_en = $_POST['subject_en']; if (!empty($put_name_en)) { $image = basename($_FILES['postbilde']['name']); $check_image = $_SERVER['DOCUMENT_ROOT'].'/img/'.$image; if( (exif_imagetype($check_image) == IMAGETYPE_JPEG)||(exif_imagetype($check_image) == IMAGETYPE_GIF) ){ $put_img = $image; }else{ $img_root = $_SERVER['DOCUMENT_ROOT'].'/img/'; $kick = $img_root.$image; unlink($kick); echo INVALID IMAGE: That file looks like neither JPEG nor GIFbr /\n; $put_img = ''; } mysql_query(INSERT INTO data (subject_en, img) VALUES ('$put_name_en', '$put_img')) OR die(mysql_error()); echo 'META HTTP-EQUIV=Refresh CONTENT=0;URL=update.php'; } } else { echo The upload was unsuccessful !; } Sorry for my bad english, Thank you in advance, Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with picture Upload
PS You are inserting the image info into the database even if it's not a valid JPEG or GIF and you are throwing it out -- That's probably NOT what you really want to do anyway. So even if that's not what is wrong in this case, your logic is a bit off in that part. On Sat, April 23, 2005 7:44 am, Labunski said: Hi guys, I have to say, I've written so many scripts that had file upload functions included, but this time something strange is happening. The script passes the IMAGE_TYPE check, and picture's name stores in the database (so I guess the picture should have been stored in the dir.), but when I look at the ftp - there's no picture in the upload directory. Chmod of the directory is 777; Here it is: $realdir = $_SERVER['DOCUMENT_ROOT'].'/img/'; $uploadfile = $realdir. basename($_FILES['postbilde']['name']); if (move_uploaded_file($_FILES['postbilde']['tmp_name'], $uploadfile)) { $put_name_en = $_POST['subject_en']; if (!empty($put_name_en)) { $image = basename($_FILES['postbilde']['name']); $check_image = $_SERVER['DOCUMENT_ROOT'].'/img/'.$image; if( (exif_imagetype($check_image) == IMAGETYPE_JPEG)||(exif_imagetype($check_image) == IMAGETYPE_GIF) ){ $put_img = $image; }else{ $img_root = $_SERVER['DOCUMENT_ROOT'].'/img/'; $kick = $img_root.$image; unlink($kick); $put_img = ''; } mysql_query(INSERT INTO data (subject_en, img) VALUES ('$put_name_en', '$put_img')) OR die(mysql_error()); echo 'META HTTP-EQUIV=Refresh CONTENT=0;URL=update.php'; } } else { echo The upload was unsuccessful !; } Sorry for my bad english, Thank you in advance, Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with picture Upload
Hi guys, I have to say, I've written so many scripts that had file upload functions included, but this time something strange is happening. The script passes the IMAGE_TYPE check, and picture's name stores in the database (so I guess the picture should have been stored in the dir.), but when I look at the ftp - there's no picture in the upload directory. Chmod of the directory is 777; Here it is: $realdir = $_SERVER['DOCUMENT_ROOT'].'/img/'; $uploadfile = $realdir. basename($_FILES['postbilde']['name']); if (move_uploaded_file($_FILES['postbilde']['tmp_name'], $uploadfile)) { $put_name_en = $_POST['subject_en']; if (!empty($put_name_en)) { $image = basename($_FILES['postbilde']['name']); $check_image = $_SERVER['DOCUMENT_ROOT'].'/img/'.$image; if( (exif_imagetype($check_image) == IMAGETYPE_JPEG)||(exif_imagetype($check_image) == IMAGETYPE_GIF) ){ $put_img = $image; }else{ $img_root = $_SERVER['DOCUMENT_ROOT'].'/img/'; $kick = $img_root.$image; unlink($kick); $put_img = ''; } mysql_query(INSERT INTO data (subject_en, img) VALUES ('$put_name_en', '$put_img')) OR die(mysql_error()); echo 'META HTTP-EQUIV=Refresh CONTENT=0;URL=update.php'; } } else { echo The upload was unsuccessful !; } Sorry for my bad english, Thank you in advance, Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem, seems to be related to the character '$'
Hello all, I am hoping someone can point me in the right direction to resolving an odd bug. I tried searching the bugs database and groups, but I can't think of the terms to use while searching for my problem that the search system will accept. I have a script like the below, copied from the crypt manual page --- ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf', '$1$rasmusle$')); } ? --- On my main web server, which is running php 4.3.10 with apache this script produces the following when I view the page on the web --- string(13) $1Hat1hn6A1pw --- When I run the script from the command line [php test.php] on the exact same server I get --- string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0 --- I have also occasionaly seen some odd behavior where strings with dollar symbols $ in them won't print out correctly, but they have never seen that important.. Does anyone have any guesses, or hints about what the next step is to search for what is causing this odd behavior? Any suggestions about a better place to ask? Thanks for any help Chris Francy [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem, seems to be related to the character '$'
Hi Chris, I tried to reproduce the problem with vertsoin 4.3.3 and 5, and its working fine(producing same string). If you have not find a bug in bug database why not submit a new bug? anyway changing single quotes to double may help ;) zareef ahmed ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf', '$1$rasmusle$')); } ? On Apr 1, 2005 2:36 AM, Chris Francy [EMAIL PROTECTED] wrote: Hello all, I am hoping someone can point me in the right direction to resolving an odd bug. I tried searching the bugs database and groups, but I can't think of the terms to use while searching for my problem that the search system will accept. I have a script like the below, copied from the crypt manual page --- ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf', '$1$rasmusle$')); } ? --- On my main web server, which is running php 4.3.10 with apache this script produces the following when I view the page on the web --- string(13) $1Hat1hn6A1pw --- When I run the script from the command line [php test.php] on the exact same server I get --- string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0 --- I have also occasionaly seen some odd behavior where strings with dollar symbols $ in them won't print out correctly, but they have never seen that important.. Does anyone have any guesses, or hints about what the next step is to search for what is causing this odd behavior? Any suggestions about a better place to ask? Thanks for any help Chris Francy [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Zareef Ahmed :: A PHP Developer in India ( Delhi ) Homepage :: http://www.zareef.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem, seems to be related to the character '$'
On Thu, March 31, 2005 1:06 pm, Chris Francy said: I am hoping someone can point me in the right direction to resolving an odd bug. I tried searching the bugs database and groups, but I can't think of the terms to use while searching for my problem that the search system will accept. I have a script like the below, copied from the crypt manual page --- ?php if (CRYPT_MD5 == 1) { var_dump(crypt('rasmuslerdorf', '$1$rasmusle$')); } ? --- On my main web server, which is running php 4.3.10 with apache this script produces the following when I view the page on the web --- string(13) $1Hat1hn6A1pw --- When I run the script from the command line [php test.php] on the exact same server I get --- string(34) $1$rasmusle$rISCgZzpwk3UhDidwXvin0 --- Here's what's happening: When your Apache user runs this script, it is using whatsit encryption (DES?) that uses the 2-character salt. Which is why it starts with '$1', the first two characters of the salt you wanted to use. When *YOU* run it, you're getting the whatsit encryption (Blowfish?) that you actually wanted. This has *NOTHING* to do with dollar signs, single quotes, or double quotes. If you 'su' to the web user (if you have root and can do that) you'd probably find the same behaviour from the command line. Somehow, the Apache User is not able to find, or read, or execute, whatever it takes to use Blowfish (or whatever it is you want) but it *CAN* find, read, and execute the thingie to do DES (2-char salt). So what you gotta look for is something that isn't $path-ed or chmod-ed right for the Apache User to be able to find ($path) and read/execute (chmod) permissions. I don't really understand how the OS find/decides what encryption algorithms and makes them available to applications/users, but that's definitely the broken bit, for what that's worth. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange Problem with ctype_digit
-Original Message- CODE: ? print ctype_digit( 1094164380 ); ? END OF CODE When I run the above code, my apache server performs an illegal operation and shuts down. It will keep doing this every 20 seconds or so until you restart/stop the server manually. Does anyone else have this problem? It crashed Apache on my computer as well. The manual says that function expects you to give it a string and it will tell you if all of the digits in the string are decimals. The function probably needs better error checking on incoming parameters, but you could probably create a wrapper with gettype to handle that in the meanwhile. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange Problem with ctype_digit
Hi all, Noticed a strange problem when I was testing a time stamp to make sure it was all numbers. After an hour of debugging, I traced the problem to the ctype_digit funciton. CODE: ? print ctype_digit( 1094164380 ); ? END OF CODE When I run the above code, my apache server performs an illegal operation and shuts down. It will keep doing this every 20 seconds or so until you restart/stop the server manually. Does anyone else have this problem? I am using windows XP with SP2 installed. I also use apache 2.0.50 (latest binary build available) and PHP 4.3.9. The problem also occurs on my main server, which is running older versions of PHP and apache, but the same OS. Thanks, Stephen Edmonds
[PHP] STrange Problem
Hi, I am using RH9, Mysql 3.23.58, PHP 4.2.2, apache2.0 mysql_select_db(mydatabase,$connect_id) allways fails. I can use $connect_id = mysql_connect(localhost,apache); (YES, I do have this line before the mysql_select_db); just fine. I can run querys against the database with no problems, but for some reason, mysql_select_db(mydatabase,$connect_id) will allways return false, and I don't see any errors anywhere in any log. Why can I not select the database with this, but have no problems using the database with every other mysql function?
Re: [PHP] STrange Problem
OK, I do get the following error. 1044: Access denied for user: '@localhost' to database 'mydatabase' Even though I specify the user in mysql_connect, for some reason, mysql_select_db is trying to user a blank user, Any Ideas? Hi, I am using RH9, Mysql 3.23.58, PHP 4.2.2, apache2.0 mysql_select_db(mydatabase,$connect_id) allways fails. I can use $connect_id = mysql_connect(localhost,apache); (YES, I do have this line before the mysql_select_db); just fine. I can run querys against the database with no problems, but for some reason, mysql_select_db(mydatabase,$connect_id) will allways return false, and I don't see any errors anywhere in any log. Why can I not select the database with this, but have no problems using the database with every other mysql function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] STrange Problem
Hello PHP, Friday, March 12, 2004, 6:25:09 PM, you wrote: P OK, I do get the following error. P 1044: Access denied for user: '@localhost' to database 'mydatabase' P Even though I specify the user in mysql_connect, for some reason, P mysql_select_db is trying to user a blank user, P Any Ideas? You said that you use apache as the username for MySQL - is this something you've configured yourself? If not, it should be root and the password should be blank unless you have also set that? In which case it's missing from your connect command. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] STrange Problem
On 12 Mar 2004 Richard Davey wrote: P 1044: Access denied for user: '@localhost' to database 'mydatabase' You said that you use apache as the username for MySQL - is this something you've configured yourself? It appears he is actually using a blank username as there is noting before the '@' in the error message. If not, it should be root and the password should be blank unless you have also set that? Configuring a MySQL database with a blank root password sounds like a potential security risk to me ... why not just create a MySQL user/PW for the specific PHP application and connect that way. Then you can grant that user just the privileges they need to deal with the actions the web page can take (SELECT, UPDATE, INSERT, and DELETE might be enough, or even too much). -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] STrange Problem
Yes, I have it configured to run as apache. But, as I mentioned, I have no problems accessing the database and running querys against it, it is only the mysql_select_db function that fails. Hello PHP, Friday, March 12, 2004, 6:25:09 PM, you wrote: P OK, I do get the following error. P 1044: Access denied for user: '@localhost' to database 'mydatabase' P Even though I specify the user in mysql_connect, for some reason, P mysql_select_db is trying to user a blank user, P Any Ideas? You said that you use apache as the username for MySQL - is this something you've configured yourself? If not, it should be root and the password should be blank unless you have also set that? In which case it's missing from your connect command. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] STrange Problem
Hello trlists, Friday, March 12, 2004, 6:37:34 PM, you wrote: tcc Configuring a MySQL database with a blank root password sounds like a tcc potential security risk to me ... It is, but if he hasn't modified it otherwise, that's what it'll be. Also for local development purposes, there is no harm in it. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] STrange Problem
On 12 Mar 2004 Richard Davey wrote: It is, but if he hasn't modified it otherwise, that's what it'll be. Also for local development purposes, there is no harm in it. Agreed, as long as he's not connected so someone can try to connect to the MySQL port. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] STrange Problem
Hello trlists, Friday, March 12, 2004, 6:48:03 PM, you wrote: tcc Agreed, as long as he's not connected so someone can try to connect to tcc the MySQL port. If he's connected that long and not running a firewall, he deserves it ;) -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] STrange Problem
Hello, Friday, March 12, 2004, 6:38:37 PM, you wrote: P Yes, I have it configured to run as apache. But, as I mentioned, I have no P problems accessing the database and running querys against it, it is only P the mysql_select_db function that fails. You mean you have no problems querying the database from within *MySQL* itself, right? i.e. from the command-line? As Tom pointed out, your error stated that no username was given. Have you tried the command using the root MySQL user account? It's possible the apache one hasn't been configured correctly. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[4]: [PHP] STrange Problem
Yes, I have a root password. No, I do not use root to run the server or connect to the database. Yes, I do have the user apache in the grant tables for mysql with permissions for the specific database. Yes, I can run querys against said database and connect with user apache with no problems. Only msyql_select_db will not connect, it claims I am trying to use a blank user, even though I specifically connect earlier with mysql_connect with the specific user with no problems.. Hello trlists, Friday, March 12, 2004, 6:48:03 PM, you wrote: tcc Agreed, as long as he's not connected so someone can try to connect to tcc the MySQL port. If he's connected that long and not running a firewall, he deserves it ;) -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[6]: [PHP] STrange Problem
Hello, Friday, March 12, 2004, 7:00:38 PM, you wrote: P Only msyql_select_db will not connect, it claims I am trying to use a blank P user, even though I specifically connect earlier with mysql_connect with the P specific user with no problems.. What does this output? ?php $link = mysql_connect(localhost, mysql_user, mysql_password) or die(Could not connect: . mysql_error()); echo Connected successfully; mysql_close($link); ? And don't just remove the user and password parts, fill them in. If there is no password, put . -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[6]: [PHP] STrange Problem
It returns: Connected successfully Like I said, I have not problems connecting. Only mysql_select_db will not work. Hello, Friday, March 12, 2004, 7:00:38 PM, you wrote: P Only msyql_select_db will not connect, it claims I am trying to use a blank P user, even though I specifically connect earlier with mysql_connect with the P specific user with no problems.. What does this output? ?php $link = mysql_connect(localhost, mysql_user, mysql_password) or die(Could not connect: . mysql_error()); echo Connected successfully; mysql_close($link); ? And don't just remove the user and password parts, fill them in. If there is no password, put . -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[4]: [PHP] STrange Problem
It seems the only way I can get mysql_select_db to work is to actually add a blank user to the msyql.db table with appropiate privileges. Yes, I have a root password. No, I do not use root to run the server or connect to the database. Yes, I do have the user apache in the grant tables for mysql with permissions for the specific database. Yes, I can run querys against said database and connect with user apache with no problems. Only msyql_select_db will not connect, it claims I am trying to use a blank user, even though I specifically connect earlier with mysql_connect with the specific user with no problems.. Hello trlists, Friday, March 12, 2004, 6:48:03 PM, you wrote: tcc Agreed, as long as he's not connected so someone can try to connect to tcc the MySQL port. If he's connected that long and not running a firewall, he deserves it ;) -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[8]: [PHP] STrange Problem
Hello PHP, Friday, March 12, 2004, 7:23:47 PM, you wrote: P It returns: P Connected successfully P Like I said, I have not problems connecting. Only mysql_select_db will not P work. Fine, what does this return? With foo replaced with your database name. ?php $lnk = mysql_connect('localhost', 'mysql_user', 'mysql_password') or die('Not connected : ' . mysql_error()); // make foo the current db mysql_select_db('foo', $lnk) or die ('Can\'t use foo : ' . mysql_error()); ? -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] STrange Problem
Is it possible that either $connect_id is not defined at the point where you use it in the mysql_select_db call (e.g. it's global, the call is in a function, and you forgot to use a global declaration), and/or the previosuly opened connection has been closed? What do you get if you do a var_dump($connect_id) right before the mysql_select_db call? -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem with post method
Hi list! Yesterday I've installed PHP 4.3.4 and Apache 1.3.29 on my Linux Mandrake 9.1 machine with a standard procedure: 1. cd apache_1.3.29 2. ./configure 3. cd ../php-4.3.4 4. ./configure --with-apache=../apache_1.3.29 --enable-track-vars make make install 5. cd ../apache_1.3.29 6. ./configure --activate-module=src/modules/php4/libphp4.a 7. make make install 8. cd ../php-4.3.4 9. cp php.ini-dist /usr/local/lib/php.ini 10. In httpd.conf file: AddType application/x-httpd-php .php I've encounterd a problem with this snippet of code, where I fill a form and I pass the data to a php page that should visualize it. Here is the code: //Login.php html head titleTEST/title /head form method=post action=second.php brbrbr NAME : input type=text name=ident br PASSWORD :input type=password name=psw br input type=submit name=Submit value=Submit /form /body /html //second.php ?php echo NAME = $ident br PASSWORD = $psw; ? When I execute this code in my web page http://members.lycos.co.uk/ippo80/Login.php, or in another Apache server with PHP-4.2.3 not installed by me, the name and password are correctly visualized once I click the submit button: NAME = myname PASSWORD = mypassword , but on my recently installed server I obtain NAME = PASSWORD = indicating that variable values are not transmitted. Have you any idea about the reason of this behaviour? Thank you very much for the attention, Giuliano __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem with post method
On Thursday 05 February 2004 16:41, Giuliano Ippoliti wrote: [snip] 9. cp php.ini-dist /usr/local/lib/php.ini Read the comments at the top of the file 'php.ini-recommended'. It is the same directory as the file 'php.ini-dist'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The probability of a drink getting spilled into a console is directly propotional to the cost of the console -- Murphy's Laws of Broadcast Engineering n8 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem with post method
--- Jason Wong [EMAIL PROTECTED] wrote: On Thursday 05 February 2004 16:41, Giuliano Ippoliti wrote: [snip] 9. cp php.ini-dist /usr/local/lib/php.ini Read the comments at the top of the file 'php.ini-recommended'. It is the same directory as the file 'php.ini-dist'. Thank you very much Jason: the problem was originated by register_globals = Off. I turned it into On and now it works. However in the future I'll use $_POST(...) to pass variables. Thank you very much again, Giuliano __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with dbase_add_record
Hi, i'm doing the following operation: I'm reading multiple rows from a database then writing each row into a dbf file using dbase_add_record. I'm having the following problem : - some rows are beeing written other or not to the dbf file (sometimes). - if i repeat the operation all the rows are beeing written to the dbf file Why is the same operation sometimes working some other times not working !!! ? Thx in advance for any suggestions. __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem in class creation
Hi all, I have encountered a tricky problem with PHP 4.3.1 (installed with SuSE 8.2). I don't know if it is a bug or not. Maybe is just me missing something. What I'd like to do is to pass a reference of base_class instance to the constructor of second_class (so that the newly created second_class instance can call methods from the base_class instance. It seems that if base_class constructor directly calls its method create() (that is responsible of creating the second_class instance, passing _$this_ as constructor argument) the second_class gets a copy of base_class instance and not the real thing. To test it, I have added an array ($arr) in the base_class and set a value into it. If second_class really have a reference to the real base_class instance, it should be able to print its contents, but this just doesn't work. Please, notice that if in the following code you remove the line $this-create() in the base_class constructor and add the commented line in the main body, everything works fine. What I am really missing? Please, help! Ciao, Fabio CODE STARTS HERE -- ?php class base_class { var $arr; var $class; function base_class () { $this-arr = array (); $this-class = false; // it seems to create another instance of base_class $this-create (); // this line does not work } function set ( $val ) { $this-arr [] = $val; } function create () { $this-class = new second_class ( $this ); } function test () { $this-class-dump (); } } class second_class { function second_class ( $main_class ) { $this-main_class = $main_class; } function dump () { print_r ( $this-main_class-arr ); } } $b = new base_class (); // $b-create (); // This line works as expected $b-set ( ciao ); $b-test (); print br /; print_r ( $b-arr ); ? END CODE - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem in class creation
From the looks of it, if i were to do the same, I would rather make second class the one I initiate and return it, but that would require a third. And the error is strange because you're doing something strange! What do you want to do ? Be able to access base_class stuff from second_class ? If so : ?php class base_class { function base_class() { do something ... ; } var $some = 200; }; class second_class { var $foo; function second_class($oref) //constructor { $this-foo = $oref; } }; $base = new base_class; $second = new second_class($base); $second-foo-some = 100; // here it is, base_class' some is accessible ? HTH Mukul Sabharwal From: Fabio Rotondo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 2:38 AM Subject: [PHP] Strange problem in class creation Hi all, I have encountered a tricky problem with PHP 4.3.1 (installed with SuSE 8.2). I don't know if it is a bug or not. Maybe is just me missing something. What I'd like to do is to pass a reference of base_class instance to the constructor of second_class (so that the newly created second_class instance can call methods from the base_class instance. It seems that if base_class constructor directly calls its method create() (that is responsible of creating the second_class instance, passing _$this_ as constructor argument) the second_class gets a copy of base_class instance and not the real thing. To test it, I have added an array ($arr) in the base_class and set a value into it. If second_class really have a reference to the real base_class instance, it should be able to print its contents, but this just doesn't work. Please, notice that if in the following code you remove the line $this-create() in the base_class constructor and add the commented line in the main body, everything works fine. What I am really missing? Please, help! Ciao, Fabio CODE STARTS HERE -- ?php class base_class { var $arr; var $class; function base_class () { $this-arr = array (); $this-class = false; // it seems to create another instance of base_class $this-create (); // this line does not work } function set ( $val ) { $this-arr [] = $val; } function create () { $this-class = new second_class ( $this ); } function test () { $this-class-dump (); } } class second_class { function second_class ( $main_class ) { $this-main_class = $main_class; } function dump () { print_r ( $this-main_class-arr ); } } $b = new base_class (); // $b-create (); // This line works as expected $b-set ( ciao ); $b-test (); print br /; print_r ( $b-arr ); ? END CODE - = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem in class creation
Mukul Sabharwal wrote: And the error is strange because you're doing something strange! I don't think I'm doing anything strange. What I have exposed here is a simplification of my own class loader. I have the main class that must load (include and then instance) other PHP classes. The problem is that if I do instance other classes in the loader constructor they get a copy of the loader instance and not the real instance reference. [some your code snipped] $base = new base_class; $second = new second_class($base); $second-foo-some = 100; // here it is, base_class' some is accessible I know. If you give a closer look to my own code, you'll see that there is a line (commented) doing almost the same thing as you. But I need something else. Infact, look at the end of my code, there are these two lines: $b = new base_class (); // $b-create (); // This line works if I instance the base_class and outside the constructor i do the create (as shown in the second line) everything works. And I am actually just sending ($this) as the argument (look inside the create method code), in exactly the same way I was doing in the base_class constructor. The problem is that inside the constructur THE SAME CODE DOES NOT WORK. I think it's a bug. I have worked around it by doing the two calls, but I would like to know if it is a real bug or just me doing something wrong. Ciao, Fabio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem in class creation
And the error is strange because you're doing something strange! I don't think I'm doing anything strange. What I have exposed here is a simplification of my own class loader. I have the main class that must load (include and then instance) other PHP classes. The problem is that if I do instance other classes in the loader constructor they get a copy of the loader instance and not the real instance reference. That code (looked closely) confirms you're doing something strange :) A constructor cannot call (or rather should not call) itself while being constructed. It leads to unexpected results. So technically in some cases you might be able to get it, but on most occassions you won't, it depends on how your class is made. And yours recurses, I'm presuming you wanted that for some reason (??) On almost all times your data will be still pointing to your base class (second_class). So i'm afraid your method is not reliable, dangerous none the less. The reliable and correct way of doing it is after your constructor has finished your class and made it ready (guaranteed), then you can do what you want to. = Mukul Sabharwal ([EMAIL PROTECTED]) __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange Problem
Hi all, thisis a very strange problem. i don't know where i amdoing something that is causing this. the problem is that i am working on a web portal entirely in php. i have a few hidden pages. that do the queries to the DB. now when i redirect toany page for query i get this error CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: strangely when i hit F5 or refresh the page i get redirected to the desired page. i have checked for any whitespaces. there are none. i have checked and double checked this. i am using win2k,IIS, php 4.3.0 again i have checked all the files for any space left that could be causing problem but i found none. i hope i make my self clear. Haseeb IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Strange Problem
Haseeb [EMAIL PROTECTED] wrote: Hi all, this is a very strange problem. i don't know where i am doing something that is causing this. the problem is that i am working on a web portal entirely in php. i have a few hidden pages. that do the queries to the DB. now when i redirect to any page for query i get this error CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: strangely when i hit F5 or refresh the page i get redirected to the desired page. i have checked for any whitespaces. there are none. i have checked and double checked this. i am using win2k,IIS, php 4.3.0 Have you checked your log file, usually there is an error in the log file telling you what went wrong. again i have checked all the files for any space left that could be causing problem but i found none. This usually happens when non http headers are sent to the server when it wasnt expecting them, php should be handling this. But to check this make sure you try sending out a header('Content-Type: text/plain') first thing in the script then dont do a redirect and see if some text is showing up that shouldn't be. i hope i make my self clear. Haseeb Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange Problem
This is an IIS issue. The install.txt has specific information on this topic, have a look. Also, this comes up a lot and the following bug report is full of newbies asking bogus questions but it also contains some good info: http://bugs.php.net/bug.php?id=12061 So it looks like security/permission settings where the php cgi lacks permission. Also: http://php.net/manual/en/faq.installation.php#faq.installation.cgierror Regards, Philip On Mon, 14 Jul 2003, Curt Zirzow wrote: Haseeb [EMAIL PROTECTED] wrote: Hi all, this is a very strange problem. i don't know where i am doing something that is causing this. the problem is that i am working on a web portal entirely in php. i have a few hidden pages. that do the queries to the DB. now when i redirect to any page for query i get this error CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: strangely when i hit F5 or refresh the page i get redirected to the desired page. i have checked for any whitespaces. there are none. i have checked and double checked this. i am using win2k,IIS, php 4.3.0 Have you checked your log file, usually there is an error in the log file telling you what went wrong. again i have checked all the files for any space left that could be causing problem but i found none. This usually happens when non http headers are sent to the server when it wasnt expecting them, php should be handling this. But to check this make sure you try sending out a header('Content-Type: text/plain') first thing in the script then dont do a redirect and see if some text is showing up that shouldn't be. i hope i make my self clear. Haseeb Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem with size of uploaded files..
I've searched all over for the answer to this problem.. but haven't found anything.. I have a script that i use to upload files to a webserver and download them via my phone.. problem is, the files end up being about twice the size of the original file.. for example,i upload a midi that is 22022 bytes, on the server it ends up being 42762 bytes. they are mostly midi and jpeg files.. this has worked fine in for the last 3 or 4 months on a different server. i recently moved my script to my other server and this started happening.. the old server was on linux, Apache/1.3.27 PHP Version 4.3.0 the new server is on linux, Apache/2.0.44 PHP Version 4.3.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem
Hello friends, Following is the part html output of my page got from View-source in IE. The problem is that I gate a big blank gap on the output page from the top until about 10 lines height and only then the table is displayed. As you see I have no BR tags here. Can someone tell me why I get blank space? Quote : html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body table width=800 border=0 cellspacing=0 cellpadding=0 tr td colspan=6 STRONGThe Whatson database has found the following 15 students :/STRONG /td /tr tr td width=106nbsp;/td td width=570nbsp;/td td width=30nbsp;/td td width=30nbsp;/td td width=30nbsp;/td td width=34nbsp;/td /tr tr td Unquote Thanks Denis
Re: [PHP] strange problem
Look for anything outside of the tr or td tags in the rest of your table. That's generally what causes things like this. ---John Holmes... - Original Message - From: Denis L. Menezes [EMAIL PROTECTED] To: PHP general list [EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 10:40 AM Subject: [PHP] strange problem Hello friends, Following is the part html output of my page got from View-source in IE. The problem is that I gate a big blank gap on the output page from the top until about 10 lines height and only then the table is displayed. As you see I have no BR tags here. Can someone tell me why I get blank space? Quote : html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body table width=800 border=0 cellspacing=0 cellpadding=0 tr td colspan=6 STRONGThe Whatson database has found the following 15 students :/STRONG/td /tr tr td width=106nbsp;/td td width=570nbsp;/td td width=30nbsp;/td td width=30nbsp;/td td width=30nbsp;/td td width=34nbsp;/td /tr tr td Unquote Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem
Hello friends. I have the following script. Both the errors show green font when actually the first error should give a red font. Am I doing something wrong here? Quote: if($CategoryName==){ Print font color=\#FF\You have not entered the category name. Please go back and enter the category name./font; Exit; } if($password==){ Print font color=\#00FF00\You have not entered the password. Please go back and enter the password./font; Exit; } Unquote Thanks Denis
Re: [PHP] Strange problem
On Saturday 01 February 2003 20:08, Denis L. Menezes wrote: Hello friends. I have the following script. Both the errors show green font when actually the first error should give a red font. Am I doing something wrong here? Quote: if($CategoryName==){ Print font color=\#FF\You have not entered the category name. Please go back and enter the category name./font; Exit; } if($password==){ Print font color=\#00FF00\You have not entered the password. Please go back and enter the password./font; Exit; } Unquote Have a look the HTML output resulting from the above code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The herd instinct among economists makes sheep look like independent thinkers. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem
- Original Message - From: Denis L. Menezes [EMAIL PROTECTED] To: PHP general list [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 7:08 AM Subject: [PHP] Strange problem I have the following script. Both the errors show green font when actually the first error should give a red font. Am I doing something wrong here? Have you looked at the html? That green shows up with the color setting is screwed up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem (user poll)
Can anyone see a problem in this? When i run the script i am getting this error Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13 ? // addpoll.php // Case Study 1: User Poll - Foundation PHP for Flash // If the form has been submitted... (line 13) if ($action == add) { // Include config file include('common.php'); // Connect to database $link = dbConnect(); // Get date for new poll $posted = time(); // Build query to insert new poll $query = INSERT INTO polls (question, option1, option2, option3, posted) VALUES('$question', '$option1', '$option2', '$option3', $posted); // Execute query $result = @mysql_query($query); // If query failed... if (!$result) { // Display error print font color=\#ff\Could not insert poll/fontbr\n; } else { print font color=\#ff\Poll added/fontbr\n; } mysql_close($link); } ? please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem (user poll)
Hello Paul, well problem is this: you don't have defined variable $actionmaybe you are not posting it correctly from form...what is on first 12 lines? try to add $action=value; on line 12...just define any suitable value... -- Best regards, Martin mail [EMAIL PROTECTED] mobile +421.907.303.393 icq34358414 wwwhttp://www.corwin.sk PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri. by Douglas Adams Wednesday, January 8, 2003, 11:43:12 PM, you wrote: PF Can anyone see a problem in this? When i run the script i am getting this PF error Notice: Undefined variable: action in PF C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13 PF ? PF // addpoll.php PF // Case Study 1: User Poll - Foundation PHP for Flash PF // If the form has been submitted... PF (line 13) if ($action == add) { PF // Include config file PF include('common.php'); PF // Connect to database PF $link = dbConnect(); PF // Get date for new poll PF $posted = time(); PF // Build query to insert new poll PF $query = INSERT INTO polls (question, option1, option2, option3, PF posted) PF VALUES('$question', '$option1', '$option2', '$option3', PF $posted); PF // Execute query PF $result = @mysql_query($query); PF // If query failed... PF if (!$result) { PF // Display error PF print font color=\#ff\Could not insert poll/fontbr\n; PF } else { PF print font color=\#ff\Poll added/fontbr\n; PF } PF mysql_close($link); PF } ? PF please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] strange problem (user poll)
You need to check like this: if (isset($action) $action == 'add') AND if it is 4.1 + and global vars are turned off?? if (isset($_GET['action']) $_GET['action'] == 'add') ** The above will need to changed if it is POST in the above example!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 8:43 AM To: [EMAIL PROTECTED] Subject: [PHP] strange problem (user poll) Can anyone see a problem in this? When i run the script i am getting this error Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13 ? // addpoll.php // Case Study 1: User Poll - Foundation PHP for Flash // If the form has been submitted... (line 13) if ($action == add) { // Include config file include('common.php'); // Connect to database $link = dbConnect(); // Get date for new poll $posted = time(); // Build query to insert new poll $query = INSERT INTO polls (question, option1, option2, option3, posted) VALUES('$question', '$option1', '$option2', '$option3', $posted); // Execute query $result = @mysql_query($query); // If query failed... if (!$result) { // Display error print font color=\#ff\Could not insert poll/fontbr\n; } else { print font color=\#ff\Poll added/fontbr\n; } mysql_close($link); } ? please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] strange problem (user poll)
[EMAIL PROTECTED] It would help to know where $action is being defined. - Original Message - From: - [ Paul Ferrie ] - [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 08, 2003 3:43 PM Subject: [PHP] strange problem (user poll) Can anyone see a problem in this? When i run the script i am getting this error Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13 ? // addpoll.php // Case Study 1: User Poll - Foundation PHP for Flash // If the form has been submitted... (line 13) if ($action == add) { // Include config file include('common.php'); // Connect to database $link = dbConnect(); // Get date for new poll $posted = time(); // Build query to insert new poll $query = INSERT INTO polls (question, option1, option2, option3, posted) VALUES('$question', '$option1', '$option2', '$option3', $posted); // Execute query $result = @mysql_query($query); // If query failed... if (!$result) { // Display error print font color=\#ff\Could not insert poll/fontbr\n; } else { print font color=\#ff\Poll added/fontbr\n; } mysql_close($link); } ? please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem (user poll)
I have no idea what I did but this email was not supposed to go to the list.. my apologies. *LOL* -Kevin - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 08, 2003 4:18 PM Subject: Fw: [PHP] strange problem (user poll) [EMAIL PROTECTED] It would help to know where $action is being defined. - Original Message - From: - [ Paul Ferrie ] - [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 08, 2003 3:43 PM Subject: [PHP] strange problem (user poll) Can anyone see a problem in this? When i run the script i am getting this error Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13 ? // addpoll.php // Case Study 1: User Poll - Foundation PHP for Flash // If the form has been submitted... (line 13) if ($action == add) { // Include config file include('common.php'); // Connect to database $link = dbConnect(); // Get date for new poll $posted = time(); // Build query to insert new poll $query = INSERT INTO polls (question, option1, option2, option3, posted) VALUES('$question', '$option1', '$option2', '$option3', $posted); // Execute query $result = @mysql_query($query); // If query failed... if (!$result) { // Display error print font color=\#ff\Could not insert poll/fontbr\n; } else { print font color=\#ff\Poll added/fontbr\n; } mysql_close($link); } ? please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with MAIL
Hi all, I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail([EMAIL PROTECTED], My Subject, Line 1\nLine 2\nLine 3); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with PHP,SSI
PHP version: 4.2.1 OS: RedHat Linux 8 Apache version: 2.0 My problem is that I can't execute more than one (SSI include) on my website JUST for PHP file.. so there is NO problems at all if I include HTML or SHTML files. Anyway, if I include 2 PHP files into any page, the first INCLUDE statement would execute correctly and print out the file output, but the second INCLUDE statement would NOT execute, and instead, the statement printed in the page source as it is: !--#include virtual=sympoll/poll.php?id=2 -- notice that this problem was not exist in my server before I upgrade PHP from 4.1.2 to 4.2.1 and Apache from 1.3 to 2.0 and Linux from 7.3 to 8.0 !! any idea?
[PHP] Strange Problem......
Hi All, I have an XML. Using XSL How do i do grouping and counting in an efficient way. Thanks karthikeyan.
[PHP] Strange problem with objects
Hey all, I'm having a strange problem with objects that I'm hoping someone out there can help me track down. I'll give a run down of the setup here, please note that register_globals is off. A page creates two objects. $document - this is always a new object and uses the ob_ functions to control the output. ob_start is called with a customer callback that writes the output to a file based on $_SERVER variables. $session - this is an object that gets serialized whenever a request finishes and unserialized when the request begins. Each object uses register_shutdown_function(array($this, desconstructor)) to set a hook to clean up after itself which works without problems. The following is then set. $document-session = $session; $session-document = $document; Everything works fine through out the page all properties of the session can be accessed and set via $session-whatever or $document-session-whatever and vice versa for the $document object. The problem arises when the $document-deconstructor function is called. As described above the ob_ callback fires and properly writes the captured output to a file then calls ob_end_clean() to dump the buffer and returns nothing, then right after the deconstructor function is called which does the following: include(a header file.php); include(the temp file from ob_); include(a footer file.php); unlink(the temp file from ob_); Now this works beautifully, except that some of the object properties get destoryed. For instance since the includes are called from $document-deconstructor it makes sense that $this should reference the document object and that $this-session should reference the session object, but the following happens. In the file I have this: $this is a ?=get_class($this)?br $tihs-session is a ?get_class($this-session)?br Which returns: $this is a rj_document $this-session is a Now I thought that it might be because the session object is destroyed before the document object fires its deconstructor call so when the objects are associated I changed the document line to be: $document-session = $session But I get the same results. Anyone have any insight? Thanks, Evan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange problem with objects
Never mind, I just found and exceptable work around. $GLOBALS[session] $GLOBALS[document] contain the objects. (and after all that typing :) -Evan On Wed, Jul 24, 2002 at 10:21:32PM -0400, Evan said: Hey all, I'm having a strange problem with objects that I'm hoping someone out there can help me track down. I'll give a run down of the setup here, please note that register_globals is off. A page creates two objects. $document - this is always a new object and uses the ob_ functions to control the output. ob_start is called with a customer callback that writes the output to a file based on $_SERVER variables. $session - this is an object that gets serialized whenever a request finishes and unserialized when the request begins. Each object uses register_shutdown_function(array($this, desconstructor)) to set a hook to clean up after itself which works without problems. The following is then set. $document-session = $session; $session-document = $document; Everything works fine through out the page all properties of the session can be accessed and set via $session-whatever or $document-session-whatever and vice versa for the $document object. The problem arises when the $document-deconstructor function is called. As described above the ob_ callback fires and properly writes the captured output to a file then calls ob_end_clean() to dump the buffer and returns nothing, then right after the deconstructor function is called which does the following: include(a header file.php); include(the temp file from ob_); include(a footer file.php); unlink(the temp file from ob_); Now this works beautifully, except that some of the object properties get destoryed. For instance since the includes are called from $document-deconstructor it makes sense that $this should reference the document object and that $this-session should reference the session object, but the following happens. In the file I have this: $this is a ?=get_class($this)?br $tihs-session is a ?get_class($this-session)?br Which returns: $this is a rj_document $this-session is a Now I thought that it might be because the session object is destroyed before the document object fires its deconstructor call so when the objects are associated I changed the document line to be: $document-session = $session But I get the same results. Anyone have any insight? Thanks, Evan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with apache 2.0.39/php 4.2.1/gd-lib
hello everybody, i'm trying to use php 4.2.1 with apache 2.0.39. i compiled php as dso, with gd support (libjpeg6b, libpng-1.2.3 , gdlib-1.8.4, freetype-2.1.2) compiling and installation of the above packages went fine, but when i start apache, i get the following message from the apache error log: 'PHP Warning: Unable to load dynamic library '/usr/local/lib/php/extensions/gd.so' - /usr/local/lib/php/extensions/gd.so: undefined symbol: gdImagePngCtx in Unknown on line 0' i tried several versions of gd-lib and libpng and recompiled php, but i always got the same error message. does anybody have an idea ? thanks in advance martin Martin Lucas - ICT Manager - TechConsult GmbH European IT-Marketing Research Am Platz der Deutschen Einheit Leipziger Str. 35-37 34125 Kassel FON: +49(0)561 - 8109 172 FAX: +49(0)561 - 8109 2972 mailto:[EMAIL PROTECTED] http://www.techconsult.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem passing variables
Hi, A friend of me use PHP4.1.2 on Linux+Apache Here is the problem : He pass a parameter using GET method : http://www.domain.com/test.php?TESTV=1234 test.php is : ?php echo $TESTV.BR; echo $HTTP_GET_VARS[TESTV].BR; phpinfos(); ? But in the script all variables are empty ($TESTV and $HTTP_GET_VARS[TESTV]). phpinfos() shows QUERY_STRING environment variable is empty... any idea ?? Thank you ! EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange problem passing variables
Try using $_GET['varnamehere'] Ray Hunter -Original Message- From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 8:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange problem passing variables Hi, A friend of me use PHP4.1.2 on Linux+Apache Here is the problem : He pass a parameter using GET method : http://www.domain.com/test.php?TESTV=1234 test.php is : ?php echo $TESTV.BR; echo $HTTP_GET_VARS[TESTV].BR; phpinfos(); ? But in the script all variables are empty ($TESTV and $HTTP_GET_VARS[TESTV]). phpinfos() shows QUERY_STRING environment variable is empty... any idea ?? Thank you ! EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem
Hi, my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I know, I should not use non-alphanumerics, but it used to work) and this key I cannot use anymore: php does not take %coding, nor '%coding', nor %coding. Can someone help me out ? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strange problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 18-01-02 at 15:49 * Marc Logghe said Hi, my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I know, I should not use non-alphanumerics, but it used to work) and this key I cannot use anymore: php does not take %coding, nor '%coding', nor %coding. Can someone help me out ? Marc No idea, but a fella on this list told me [] had been deprecated in favour of {} Maybe that has something to do with it? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8SDaaHpvrrTa6L5oRAq/iAKCFdCMULk8xWwcT1mMhgPF0Xsj3QwCcCxE+ M+YsJ4QKu1szbP5tkGScES4= =bTv8 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strange problem
hmmm try $coding = %coding; $a[$coding]='whatever this array shall contain'; please let me know if it worked... diggn - Original Message - From: Marc Logghe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 18, 2002 3:44 PM Subject: [PHP] strange problem Hi, my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I know, I should not use non-alphanumerics, but it used to work) and this key I cannot use anymore: php does not take %coding, nor '%coding', nor %coding. Can someone help me out ? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strange problem
hmmm try $coding = %coding; $a[$coding]='whatever this array shall contain'; please let me know if it worked... diggn this is a test because my email client gave me an error message so if this message arrives twice, it wasnt meant to be spam...
Re: [PHP] strange problem
No idea, but a fella on this list told me [] had been deprecated in favour of {} Maybe that has something to do with it? Maybe: $a[${'%coding'}] = 'red'; this works: ? ${'%coding'}='blue'; $a[${'%coding'}]='red'; echo $a[blue];//print red ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strange problem
On Friday, January 18, 2002, at 09:52 AM, Nick Wilson wrote: my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I know, I should not use non-alphanumerics, but it used to work) and this key I cannot use anymore: php does not take %coding, nor '%coding', nor %coding. Can someone help me out ? Marc No idea, but a fella on this list told me [] had been deprecated in favour of {} Maybe that has something to do with it? From what I understand (as a participant in that thread), [] hasn't been deprecated for all arrays, just the situations in which you want to consider a string as an array of characters and are using a numeric index to point to a specific character. Like so: $string = abcdefg; echo $string{3}; (should print d unless I'm doing this wrong). For most other arrays, brackets are still OK. Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strange problem
On Friday 18 January 2002 15:52, you wrote: So hashes are now $var{'keyname'} (with curly brackets) and arrays are $var[0] (with normal brackets?) -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 18-01-02 at 15:49 * Marc Logghe said Hi, my PHP (PHP Version 4.1.1) suddenly does not take this anymore: $a['color'] = 'red'; I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' when I remove the quotes around the key, it works. Problem is , that a certain key is %coding (I know, I know, I should not use non-alphanumerics, but it used to work) and this key I cannot use anymore: php does not take %coding, nor '%coding', nor %coding. Can someone help me out ? Marc No idea, but a fella on this list told me [] had been deprecated in favour of {} Maybe that has something to do with it? - -- Nick Wilson Tel: +45 3325 0688 Fax: +45 3325 0677 Web: www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8SDaaHpvrrTa6L5oRAq/iAKCFdCMULk8xWwcT1mMhgPF0Xsj3QwCcCxE+ M+YsJ4QKu1szbP5tkGScES4= =bTv8 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange problem with some includes...
I have this page: http://www.metalages.com/2002/reviews/rev-evergrey-insearchoftruth.php If you look on the bottom, it says: Warning: Failed opening 'http://www.metalages.com/includes/relatedinfo/inc-evergrey.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/metalages/2002/reviews/rev-evergrey-insearchoftruth.php on line 209 The weird thing is, those paths are CORRECT and DO contain those files! WEIRD! Has anyone had something like this happen or know a cause as to why this would not work even if the paths it is looking for are 100% correct? If you need to know the code in my page I'll be happy to provide, I'm stumped! Deron www.metalages.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange problem with some includes...
It looks like you put a full URL into your include ... which would be incorrect. The syntax is ... include(path/relative/to/your/script); jim -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange problem with some includes...
Hi Jim! Ok couple of questions then... .. yesterday these includes WERE working. For some reason I went to the site today and they weren't. VERY weird! Since these includes are showing up on multiple pages in different directories, I currently have them being called like this: Code in page: (out of whack due to cut/paste) ?php include(/home/metalages/common.php); $bandname='evergrey'; for ($x=0; $xcount($GLOBALS[folders]); $x++) { if ($x 0) { $num=$x+1; } else { $num=''; } $incline=$GLOBALS[prefix] . $GLOBALS[folders][$x] . $GLOBALS[preband] . $bandname . $num . $GLOBALS[suffix]; include($incline); if ($x(count($GLOBALS[folders])-1)) { echobr\n; } } ? Then I have a common.php outside of web folder with this code: ?php $prefix='http://www.metalages.com/includes/'; $folders=array('relatedinfo/','alsosee/','sounds/','progged/'); $preband='inc-'; $suffix='.php'; ? So, since it DID work yesterday for me, the code I have set up isn't correct? I'm baffled by the fact that it did work for me yesterday, I kinda wish it didn't now! LoL! Jimtronic [EMAIL PROTECTED] wrote in message news:p05101010b8359cecd8f0@[192.168.1.17]... It looks like you put a full URL into your include ... which would be incorrect. The syntax is ... include(path/relative/to/your/script); jim -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange problem with some includes...
Yes sir: -rw-rw-r-- Directory : drwxrwsr-x Deron www.metalages.com Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... look at read permissions, does the web server have permissions to read those files? -Original Message- From: Deron [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange problem with some includes... I have this page: http://www.metalages.com/2002/reviews/rev-evergrey-insearchoftruth.php If you look on the bottom, it says: Warning: Failed opening 'http://www.metalages.com/includes/relatedinfo/inc-evergrey.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/metalages/2002/reviews/rev-evergrey-insearchoftruth.php on line 209 The weird thing is, those paths are CORRECT and DO contain those files! WEIRD! Has anyone had something like this happen or know a cause as to why this would not work even if the paths it is looking for are 100% correct? If you need to know the code in my page I'll be happy to provide, I'm stumped! Deron www.metalages.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange problem...
Hi, i have a strange problem. I get a users birthdate with three dropdown menus (year, month and day of month). I get these values into one string with: $user_birthdate = $birth_year . $birth_month . $birth_day; If i echo $user_birthdate after this it is correct (mmdd). But when i insert the value of $user_birthdate into MySql it gets the value '8388607'. It doesn´t matter what value $user_birthdate had originally - it always inserts as 8388607. Any ideas??? The db question looks like this btw: $query = INSERT INTO users ; $query .= (user_name, user_birthdate, user_city, user_mail, user_icq, user_msn, user_www, user_login, user_password) ; $query .= values('$user_name', '$user_birthdate', '$user_city', '$user_mail', '$user_icq', '$user_msn', '$user_www', '$user_login', '$user_password'); Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Strange problem...
Hello Daniel, $date = $birth_year.-.$birth_month.-.$birth_day; And you can try inserting such kind o' date to a DATETIME field. There's an alternative way: $time = mktime(0,0,0, $birth_month, $birth_day, $birth_year); That would return a unix timestamp that can be written to a BIGINT field and in future returned by using date(m.d.Y, $time) from your sql query. He. DA Thanks Jim. DA but how would i actually do that? I have studied the date() function in the DA manual - but can´t find a way of inserting a set value from user input as a DA valid date. DA - D Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange problem with fputs ($fp, $newVote)
Hi, I'm having strange problem with the fputs() - it occurs only on my IIS server but not on the Linux/apache server (I use the IIS while programming). The problem: fputs ($fp, $newVote); It does not write the content of $newVote into the text file $fp is pointing to. If I check the value of fputs like: $test = fputs ($fp, $newVote); echo $test; I get the number 0 - but notice I don't get any error messages. Does anyone know why this acts like that? If I echo the permission of the file I get this: 33206 (what does that mean?). Regards, Sumarlidi Einar Dadason SED - Graphic Design -- Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: [EMAIL PROTECTED] Homepage:www.sed.is -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strange problem with fputs ($fp, $newVote)
Hi again, I got around the problem just by doing following. However, the problem is weird (I'm using PHP 4.0.5 for IIS). $fp = fopen ($filename, a+); $fileContent = fread ($fp, filesize ($filename)); ... fclose ($fp); $fp = fopen ($filename, a); - the plus taken away! ftruncate ($fp, 0); fwrite ($fp, $newVote); fclose ($fp); Can this be a bug? SED -Original Message- From: SED [mailto:[EMAIL PROTECTED]] Sent: 7. júlí 2001 21:56 To: [EMAIL PROTECTED] Subject: [PHP] Strange problem with fputs ($fp, $newVote) Hi, I'm having strange problem with the fputs() - it occurs only on my IIS server but not on the Linux/apache server (I use the IIS while programming). The problem: fputs ($fp, $newVote); It does not write the content of $newVote into the text file $fp is pointing to. If I check the value of fputs like: $test = fputs ($fp, $newVote); echo $test; I get the number 0 - but notice I don't get any error messages. Does anyone know why this acts like that? If I echo the permission of the file I get this: 33206 (what does that mean?). Regards, Sumarlidi Einar Dadason SED - Graphic Design -- Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: [EMAIL PROTECTED] Homepage:www.sed.is -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strange problem
Sounds like there's no swap space left to me... -jp -Original Message- From: Dustin Butler [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 11:11 PM To: 'Jeroen Jochems'; php-general (E-mail) Subject: RE: [PHP] Strange problem There are FTP functions if it's an FTP download. You could also use socket functions to create the request if it's HTTP. Check your system for the utility called wget, you could exec() wget to retrieve the file also. Dustin -Original Message- From: Jeroen Jochems [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:23 AM To: Hardy Merrill Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Strange problem Or does anyone know a better way to download files? - Original Message - From: Hardy Merrill [EMAIL PROTECTED] To: Jeroen Jochems [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 25, 2001 2:50 PM Subject: Re: [PHP] Strange problem The first thing I'd check is the space on the client machine trying to do the download - that machine may be running out of space. I can't remember exactly how the browser handles this, but the client machine may need 2 times the size of the file to be downloaded - it might first create a temporary file, and then when the download is done, copy the temporary file to the real file. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jeroen Jochems [[EMAIL PROTECTED]] wrote: When I try to download a big file (like 5meg) with fopen() I get some strange errors: - not enough space for lowio initialization - not enough space for stdio initialization - pure virtual function call - not enough space for _onexit/atexit table - unable to open console device - unexpected heap error - unexpected multithread lock error - not enough space for thread data abnormal program termination - not enough space for environment - not enough space for arguments I use the following code while (!feof($file)) { $line = fgets($file, 1); fputs($localfile,"$line"); } This always happens when he downloaded 981kb. Anyone know how to solve this? 10xzs - floating point not loaded -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange problem
No it has got about 10gig free space! - Original Message - From: Hardy Merrill [EMAIL PROTECTED] To: Jeroen Jochems [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 25, 2001 2:50 PM Subject: Re: [PHP] Strange problem The first thing I'd check is the space on the client machine trying to do the download - that machine may be running out of space. I can't remember exactly how the browser handles this, but the client machine may need 2 times the size of the file to be downloaded - it might first create a temporary file, and then when the download is done, copy the temporary file to the real file. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jeroen Jochems [[EMAIL PROTECTED]] wrote: When I try to download a big file (like 5meg) with fopen() I get some strange errors: - not enough space for lowio initialization - not enough space for stdio initialization - pure virtual function call - not enough space for _onexit/atexit table - unable to open console device - unexpected heap error - unexpected multithread lock error - not enough space for thread data abnormal program termination - not enough space for environment - not enough space for arguments I use the following code while (!feof($file)) { $line = fgets($file, 1); fputs($localfile,"$line"); } This always happens when he downloaded 981kb. Anyone know how to solve this? 10xzs - floating point not loaded -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange problem
Or does anyone know a better way to download files? - Original Message - From: Hardy Merrill [EMAIL PROTECTED] To: Jeroen Jochems [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 25, 2001 2:50 PM Subject: Re: [PHP] Strange problem The first thing I'd check is the space on the client machine trying to do the download - that machine may be running out of space. I can't remember exactly how the browser handles this, but the client machine may need 2 times the size of the file to be downloaded - it might first create a temporary file, and then when the download is done, copy the temporary file to the real file. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jeroen Jochems [[EMAIL PROTECTED]] wrote: When I try to download a big file (like 5meg) with fopen() I get some strange errors: - not enough space for lowio initialization - not enough space for stdio initialization - pure virtual function call - not enough space for _onexit/atexit table - unable to open console device - unexpected heap error - unexpected multithread lock error - not enough space for thread data abnormal program termination - not enough space for environment - not enough space for arguments I use the following code while (!feof($file)) { $line = fgets($file, 1); fputs($localfile,"$line"); } This always happens when he downloaded 981kb. Anyone know how to solve this? 10xzs - floating point not loaded -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]