[PHP] Dumb Question - Casting
Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n;
Re: [PHP] Dumb Question - Casting
On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote: Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n; It works as expected if you take out the int() parts in each line. I'm not sure why, but the use of int() seems to be screwing around with the results. That's why the first line outputs a 0. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Dumb Question - Casting
On Thu, Feb 18, 2010 at 10:50 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote: Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n; It works as expected if you take out the int() parts in each line. I'm not sure why, but the use of int() seems to be screwing around with the results. That's why the first line outputs a 0. Thanks, Ash http://www.ashleysheridan.co.uk Another fine example of floating point math. ?php $x = ((0.1 + 0.7) * 10); echo ((0.1 + 0.7) * 10) === $x\n; // ((0.1 + 0.7) * 10) === 8 var_dump(8 == $x); // bool(false) var_dump($x - (int) $x); // float(1) var_dump(8 - $x); // float(8.8817841970013E-16) ? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question - Casting
On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com wrote: Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n; The reason why you get 7 instead of 8 is because you are using floating point arithmetic. 0.1 (i.e. the fraction 1/10) does not have a finite representation in base 2 (like you cannot finitely represent 1/3 in base 10). So the number 0.1 is represented in the computer as a number that is strictly less than 0.1 so when you do 0.1+0.7=x then you have x0.8 in the computer (think 7.999...). When you cast to int you just truncate the number, i.e. you chop off the fractional part leaving you with 7. -- Daniel Egeberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question - Casting
According to the PHP manual using the same expression, Never cast an unknown fraction to integer, as this can sometimes lead to unexpected results. My guess is that since it is an expression of floating points, that the result is not quite 8 (for whatever reason). Therefore, it is rounded towards 0. Of course, that is only a guess, and I have no true documentation on it. Ashley Sheridan wrote: On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote: Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n; It works as expected if you take out the int() parts in each line. I'm not sure why, but the use of int() seems to be screwing around with the results. That's why the first line outputs a 0. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Dumb Question - Casting
Daniel Egeberg wrote: On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com wrote: Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty. Can someone explain why the second expression in this code snippet evaluates to 7 and not 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n; The reason why you get 7 instead of 8 is because you are using floating point arithmetic. 0.1 (i.e. the fraction 1/10) does not have a finite representation in base 2 (like you cannot finitely represent 1/3 in base 10). So the number 0.1 is represented in the computer as a number that is strictly less than 0.1 so when you do 0.1+0.7=x then you have x0.8 in the computer (think 7.999...). When you cast to int you just truncate the number, i.e. you chop off the fractional part leaving you with 7. yup as Daniel pointed out; this is correct - love floats casting! see: $y = ((0.1 + 0.7) * 10); $x = (int)$y; $z = intval($y); var_dump($y); var_dump(serialize($y)); var_dump($x); var_dump($z); outputs: float(8) string(55) d:7.99911182158029987476766109466552734375; int(7) int(7) lovely! - note: serializing gives us the exact value of the float regards, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb
Thanks, that is what I figured. I really don't get rpm's, it seems you are stuck with whatever the packager felt like putting in the rpm. Want to add a library? Like zlib for example? then you have to re-compile it yourself anyways. They seem completely useless to me for anything but a very basic program with no real compile options. - Original Message - From: Jason Davidson [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 11:44 AM Subject: Re: [PHP] Dumb Not a dumb question at all. I suppose you could try forcefeeding the php rpm into the system again, but that is certainly not the 'nice' way. I think short of installing php or the php module again, Im not sure you can simply change a config setting or anything. My experience in the past, is that , the rpms of apache and php have been flakey, that was 3 years ago, and Im sure its improved a great deal, but nontheless, i prefer to compile apache and php, and rpm mysql. Seems to be easier. Good Luck Jason PHP [EMAIL PROTECTED] wrote: Hi, I have a dum question. I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and php4 are all installed , via rpm I am assuming. I upgraded mysql to version 4, however, php is still using the version 3 client. (from php_info) How do I get php4 to use the mysql4 client? I would like to know if this is possible just using rpms. I could do it re-compiling everything myself, but I kind of want to stick to the rpm style installation on this server if possible. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb
PHP wrote: Thanks, that is what I figured. I really don't get rpm's, it seems you are stuck with whatever the packager felt like putting in the rpm. Want to add a library? Like zlib for example? then you have to re-compile it yourself anyways. They seem completely useless to me for anything but a very basic program with no real compile options. Well, you can always compile from source. Or choose a distribution that doesn't use RPMs (like Debian, FreeBSD, Gentoo, et. al.) [ trimmed the rest ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb
Hi, I have a dum question. I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and php4 are all installed , via rpm I am assuming. I upgraded mysql to version 4, however, php is still using the version 3 client. (from php_info) How do I get php4 to use the mysql4 client? I would like to know if this is possible just using rpms. I could do it re-compiling everything myself, but I kind of want to stick to the rpm style installation on this server if possible. Thanks for any help.
RE: [PHP] Dumb
Go to rpmfind.net and see if you find one... Or see if you uninstall all the mysql RPMs and use the ones from mysql.com/downloads. They also have an RPM client. -Original Message- From: PHP [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 1:32 PM To: php Subject: [PHP] Dumb Hi, I have a dum question. I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and php4 are all installed , via rpm I am assuming. I upgraded mysql to version 4, however, php is still using the version 3 client. (from php_info) How do I get php4 to use the mysql4 client? I would like to know if this is possible just using rpms. I could do it re-compiling everything myself, but I kind of want to stick to the rpm style installation on this server if possible. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb
On Thursday 11 March 2004 11:38 am, Jonathan Villa wrote: Go to rpmfind.net and see if you find one... If not, try rpm.pbone.net. It seems like rpmfind's content has been lacking lately, whereas pbone seems to have everything. rpmfind has a more powerful search, though... Or see if you uninstall all the mysql RPMs and use the ones from mysql.com/downloads. They also have an RPM client. -Original Message- From: PHP [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 1:32 PM To: php Subject: [PHP] Dumb Hi, I have a dum question. I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and php4 are all installed , via rpm I am assuming. I upgraded mysql to version 4, however, php is still using the version 3 client. (from php_info) How do I get php4 to use the mysql4 client? I would like to know if this is possible just using rpms. I could do it re-compiling everything myself, but I kind of want to stick to the rpm style installation on this server if possible. Thanks for any help. -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- Give a man fire, and he'll be warm for a day; set a man on fire, and he'll be warm for the rest of his life. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dumb time question
Ok, this is going to be laughable, but here goes. I am looking at code too much to get this one: Have 2 text fields on a database called hours and minutes. How can i get the current time (hour-minutes) in two digit format and apply it to the two variables? Everything i do only gets one digit when the minutes are between 00 and 10. I know its going to be stupid but anyway, could use your help, i cant see anything straight in this code anymore. :-P Sorry and thanks. Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dumb time question
use the date() function, in this case date(i) and date(h) or date(H) Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Pag [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 13, 2003 10:25 PM Subject: [PHP] dumb time question Ok, this is going to be laughable, but here goes. I am looking at code too much to get this one: Have 2 text fields on a database called hours and minutes. How can i get the current time (hour-minutes) in two digit format and apply it to the two variables? Everything i do only gets one digit when the minutes are between 00 and 10. I know its going to be stupid but anyway, could use your help, i cant see anything straight in this code anymore. :-P Sorry and thanks. Pag -- 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] DUMB QUESTION I'M SURE
I'm just starting out, this is my script... ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = .$name.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DUMB QUESTION I'M SURE
Hi, Friday, January 3, 2003, 4:18:05 PM, you wrote: AF I'm just starting out, this is my script... AF ? AF $name = $_POST['username']; AF $name = $name; AF $db = mysql_connect(localhost); AF mysql_select_db(vinyldealers,$db); AF $query = SELECT shops.name FROM shops WHERE name = .$name.; AF $result = mysql_query($query); AF while ($record = mysql_fetch_assoc($result)) { AF while (list($feildname, $feildvalue) = each ($record)) { AF echo $feildname. : B .$feildvalue. /BBR; AF } AF echoBR; AF } ? AF This is the error I get... AF Parse error: parse error, unexpected ':' in AF C:\Xitami\webpages\php\result1.php on line 12 AF I dunno what I'm doing wrong. Help please??? Don't need the . at the end of this line: $query = SELECT shops.name FROM shops WHERE name = .$name.; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DUMB QUESTION I'M SURE
Try by adding a backslash to the : there (...\: B...) Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] Asunto: [PHP] DUMB QUESTION I'M SURE I'm just starting out, this is my script... ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = .$name.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- 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] DUMB QUESTION I'M SURE
What they mean is to make that line: $query = SELECT shops.name FROM shops WHERE name = $name; Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] Asunto: [PHP] DUMB QUESTION I'M SURE I'm just starting out, this is my script... ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = .$name.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- 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] DUMB QUESTION I'M SURE
I think it's just the $query var not having the right number of quotes. I added single quotes around the value. ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = '.$name.'; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? HTH, Jason k Larson Adam French wrote: I'm just starting out, this is my script... ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = .$name.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DUMB QUESTION I'M SURE
Quoting Cesar Aracena [EMAIL PROTECTED]: ### Try by adding a backslash to the : there (...\: B...) ### ### Cesar L. Aracena ### [EMAIL PROTECTED] ### [EMAIL PROTECTED] ### (0299) 156-356688 ### Neuquén (8300) Capital ### Argentina ### ### ### -Mensaje original- ### De: Adam French [mailto:[EMAIL PROTECTED]] ### Enviado el: viernes, 03 de enero de 2003 3:18 ### Para: [EMAIL PROTECTED] ### Asunto: [PHP] DUMB QUESTION I'M SURE ### ### I'm just starting out, this is my script... ### ### ? ### $name = $_POST['username']; ### $name = $name; ### $db = mysql_connect(localhost); ### mysql_select_db(vinyldealers,$db); ### $query = SELECT shops.name FROM shops WHERE name = .$name.; you might also want to format the above like this: $query = SELECT shops.name FROM shops WHERE name = $name; you're gonna get an error in your sql syntax otherwise ### $result = mysql_query($query); ### while ($record = mysql_fetch_assoc($result)) { ### while (list($feildname, $feildvalue) = each ($record)) { ### echo $feildname. : B .$feildvalue. /BBR; ### } ### echoBR; ### } ### ? ### ### This is the error I get... ### ### Parse error: parse error, unexpected ':' in ### C:\Xitami\webpages\php\result1.php on line 12 ### ### I dunno what I'm doing wrong. Help please??? ### ### ### ### -- ### 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] Dumb session cookie question?
Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb session cookie question?
if you are allowing cookies on your browser, and the sessions are working (as they appear to be), then there WILL be a cookie somewhere on your browsing computer. However, I think you're a little confused about what you'll find... you'll just find a cookie named PHPSESSID, with a value of XX. A common misconception about sessions is that the session vars get stored on the user's computer... WRONG. ONLY the session id is stored on the user's computer (either in a cookie, or via the URL). Session vars and values are ASSOCIATED with that session id ON THE SERVER. WHERE exactly the cookie is stored on your CLIENT (viewing) hard drive will depend on the OS, Browser, and a heap of settings. WHERE exactly the session vars and values are stored on your SERVER will depend on a few PHP settings. What are you trying to achieve? To test if a cookie exists on the user's computer, you use the $_COOKIE array. To assign values to a session, you use the $_SESSION array (which associates a php session id (stored/carried by the user) with a bunch of session vars/values stored on the server). Justin on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote: Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb session cookie question?
IE traditionally puts cookies in a folder named Cookies. Do a search for 'cookies' -- see what you come up with. on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote: Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb POST Array question
Hi all, I have a multiple select called Consultants[] In one page. On the target page, how would I reference it? Would it be: $_POST['Consultants'][0] $_POST['Consultants'][1] Etc Or something else? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
Re: [PHP] Dumb POST Array question
On Monday 25 November 2002 16:48, David Russell wrote: Hi all, I have a multiple select called Consultants[] In one page. On the target page, how would I reference it? Would it be: $_POST['Consultants'][0] $_POST['Consultants'][1] If in doubt, print it out (TM): print_r($_POST); The best way to do it (IMHO) is to: foreach ($_POST['Consultants'] as $key = value) { print $key: $valuebr; } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Make it myself? But I'm a physical organic chemist! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb Question
And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question
My "dumb" answer :) Try Google. Type: "procedural code" You might want to check, "object-oriented" as well... I'm sure, you'll find helpful explanations... - E And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] Dumb Question
Google didn't have much to offer. But if I should also check 'object-oriented' then I believe it deals with classes. I thought it was something else. Just trying to figure out if phpdoc is for me, which it seems like its not :( Thanks @ Edwin wrote: My "dumb" answer :) Try Google. Type: "procedural code" You might want to check, "object-oriented" as well... I'm sure, you'll find helpful explanations... - E And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] Dumb Question
Google didn't have much to offer. Sorry 'bout that. Actually, if you have an idea of what OO ("object-oriented") is, I think I can say that "procedural" is just the opposite of it. I tried Google myself and this came out on top: "Writing Procedural Code in Non-Procedural SQL" There's a short explanation but I think it's enough to give you some hint about "procedural code". - E But if I should also check 'object-oriented' then I believe it deals with classes. I thought it was something else. Just trying to figure out if phpdoc is for me, which it seems like its not :( Thanks :) @ Edwin wrote: My "dumb" answer :) Try Google. Type: "procedural code" You might want to check, "object-oriented" as well... I'm sure, you'll find helpful explanations... - E And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] Dumb Question
On Sat, 31 Aug 2002 14:04:11 -0400, you wrote: And I feel foolish asking... What is meant by 'procedural code' ??? It's the opposite of declarative code. Here's a page that briefly explains the difference: http://www.wdvl.com/Authoring/DB/SQL/BeginSQL/beginSQL2_1.html and http://www.wdvl.com/Authoring/DB/SQL/BeginSQL/beginSQL2_2.html There may be other contexts that the term procedural could be used in, and if so it may have other meanings that I am not aware of -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question
Here is my stab at it. One person described it as the opposite of OO. So something similar to - ?php do_this() { // do this code } do_that() { // do that code } if (isset( $_GET['foo'] )) { do_this(); } else { do_that(); } ? would be considered procedural code. If Im wrong I stand corrected Michael Sims wrote: On Sat, 31 Aug 2002 14:04:11 -0400, you wrote: And I feel foolish asking... What is meant by 'procedural code' ??? It's the opposite of declarative code. Here's a page that briefly explains the difference: http://www.wdvl.com/Authoring/DB/SQL/BeginSQL/beginSQL2_1.html and http://www.wdvl.com/Authoring/DB/SQL/BeginSQL/beginSQL2_2.html There may be other contexts that the term procedural could be used in, and if so it may have other meanings that I am not aware of -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb question
Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb question
You need to declare $vari as a global variable. eg; ? function getvar() { global $vari; $vari = bollocks; } getvar(); echo $vari; ? Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Liam MacKenzie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 1:27 PM Subject: [PHP] Dumb question Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[Fwd: Re: [PHP] Dumb question]
---BeginMessage--- ? function getvar() { $vari = bollocks; # this $vari is local to function } $vari = getvar(); # this $vari is in global space echo $vari ? On Wed, 2002-08-21 at 20:35, Bob Irwin wrote: You need to declare $vari as a global variable. eg; ? function getvar() { global $vari; $vari = bollocks; } getvar(); echo $vari; ? Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Liam MacKenzie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 1:27 PM Subject: [PHP] Dumb question Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dumb
Doesn't work for those of us who are on the digest. - Theo -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 4:59 PM To: Brendan P. Caulfield; PHP Subject: Re: [PHP] dumb Thank you brendan my point from the beginning. Outlook users Message-Block Sender. Takes you two seconds. -Kevin - Original Message - From: Brendan P. Caulfield [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, July 09, 2002 2:53 PM Subject: [PHP] dumb this is dumb. can we just ignore this and move. we are all smart enough to block his posts. let's just do it and quit wasting all of our time and get back to doing what we do here. respectfully, -brendan -- 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] Dumb session / cookie / password questions
I am a little confused about storing stuff in cookies/sessions and how to prevent spoofing of them. A user logs in, his e-mail address or user id and password(md5'ed) is checked against my database. Assuming it matches, I then set a cookie with the users id + email. What is to stop someone from spoofing that cookie? I obviously don't want to put the password in a cookie .. can someone point me in the direction of an article about this? I've searched around, but I'm not finding stuff about in a preventing spoofing / security aspect. Thanks, Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb session / cookie / password questions
What I have done in the past is create a session variable that tells me that the person using that session is valid. It's really really hard to spoof a session variable. I did it this way after awhile since the original way that I did it was by checking their username/password in the session on every page hit.. Which when I have over a million hits per day begins to wear on the database.. So far using a session variable is the best way that I have found. Cheers! Rick Too much caution is bad for you. By avoiding things you fear, you may let yourself in for unhappy consequences. It is usually wiser to stand up to a scary-seeming experience and walk right into it, risking the bruises as hard knocks. You are likely to find it is not as tough as you had thought. Or you may find it plenty tough, but also discover you have what it takes to handle it. - Norman Vincent Peale From: Chad Day [EMAIL PROTECTED] Date: Wed, 10 Jul 2002 16:09:53 -0400 To: [EMAIL PROTECTED] Subject: [PHP] Dumb session / cookie / password questions I am a little confused about storing stuff in cookies/sessions and how to prevent spoofing of them. A user logs in, his e-mail address or user id and password(md5'ed) is checked against my database. Assuming it matches, I then set a cookie with the users id + email. What is to stop someone from spoofing that cookie? I obviously don't want to put the password in a cookie .. can someone point me in the direction of an article about this? I've searched around, but I'm not finding stuff about in a preventing spoofing / security aspect. Thanks, Chad -- 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] Dumb session / cookie / password questions
Firstly, you should ALWAYS use an encryption algorithm for passwords. For my site, I used md5() and match with that. That way, even if someone does get a hold of the encrypted password, it's not in their best interest (or maybe it is, if they're bored) to crack it. I haven't testing the following out, but it might work if someone wants to be a smartass and type out index.php?user=admingodpass=adminpass[EMAIL PROTECTED] in which they know the info. ?php if(!empty($_GET)) { header(Location: $PHP_SELF); } ? Putting that at the top of the page would check to see if any information was sent to the page from the $_GET superglobal, and if it was, reload the page without any URL extensions. It sounds good in theory, though I haven't tested it, so it might not work as I think it should (it NEVER does!). My $20.00 (big mouth) Martin Clifford http://www.completesource.net (Now Open!) Chad Day [EMAIL PROTECTED] 07/10/02 04:09PM I am a little confused about storing stuff in cookies/sessions and how to prevent spoofing of them. A user logs in, his e-mail address or user id and password(md5'ed) is checked against my database. Assuming it matches, I then set a cookie with the users id + email. What is to stop someone from spoofing that cookie? I obviously don't want to put the password in a cookie .. can someone point me in the direction of an article about this? I've searched around, but I'm not finding stuff about in a preventing spoofing / security aspect. Thanks, Chad -- 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] Dumb session / cookie / password questions
ðÒÉ×ÅÔ! Martin Clifford wrote: Firstly, you should ALWAYS use an encryption algorithm for passwords. For my site, I used md5() and match with that. That way, even if someone does get a hold of the encrypted password, it's not in their best interest (or maybe it is, if they're bored) to crack it. NO need for decryption. I can just present it as is and your soft's gonna drink it (and may burp afterwards) :) Putting that at the top of the page would check to see if any information was sent to the page from the $_GET superglobal, and if it was, reload the page without any URL extensions. Using Register globals off would do the same without any code add-on. And it *does* work, as many a user lately found out, in anguish for his/her vanished parameters/sessions/cookies/umbrellas and girlfriends :) Yet it cannot block your MD5 stuff from being presented back to you on the right channel (not so difficult to guess, it's three channels in all). If you don't hold CC numbers, military stuff, bank transactions or mafia secrets I can hardly see any need for paranoia (in case you do MD5ing is a *poor* solution). Having your CC processed by a secure third party will cost you much less than implementing a 90% secure system from scratch. When you have nothing to hide you also have nothing to fear :) Think about it. Most users exchange their user/passwords in emails. Hey! Wanna see what discount prices I got from that site, dude? Look, user Mickey pass MOuse (capital O, mind you, I love security, ya know). And don't tell anyone, okay? Users do it all the time. And sites, too. How many automated mails containing right the passwords you are trying to protect you'll be forced to send along the net for the sake of customer satisfaction? Most of those forgot your password? Tell us what email you gave us, we'll do the rest! will be received on public email servers, because nobody in his mind would send a commercial site his real email (I canceled my first yahoo account when I was already receiving some 50 commercials a day, mostly about penis enlargement and marijuana replacers). Those emails will remain on the account for ages, just in case the user forgot the pass again. Would you rate yahoo as a secure site? Any time I walk into a computer club while I'm on vacation I end up into somebody else's yahoo/ICQ or whatever account... I am usually trying to log out from the session that was left open. Maybe because I am too stupid to understand yahoo's security policy LOL That was just for the sake of throwing my 2 kopeki in before going to sleep (we are in no euro/dollar/sterling area either :) ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dumb
this is dumb. can we just ignore this and move. we are all smart enough to block his posts. let's just do it and quit wasting all of our time and get back to doing what we do here. respectfully, -brendan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dumb
Thank you brendan my point from the beginning. Outlook users Message-Block Sender. Takes you two seconds. -Kevin - Original Message - From: Brendan P. Caulfield [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, July 09, 2002 2:53 PM Subject: [PHP] dumb this is dumb. can we just ignore this and move. we are all smart enough to block his posts. let's just do it and quit wasting all of our time and get back to doing what we do here. respectfully, -brendan -- 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] dumb
Brendan, you have my vote. come on.. let's work. --jp At 22:53 09-07-2002, Brendan P. Caulfield wrote: this is dumb. can we just ignore this and move. we are all smart enough to block his posts. let's just do it and quit wasting all of our time and get back to doing what we do here. respectfully, -brendan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Juan Pablo Aqueveque [EMAIL PROTECTED] Ingeniero de Sistemas Departamento de Redes y Comunicaciones http://www.drc.uct.cl Universidad Católica de Temuco. Tel:(5645) 205 630 Fax:(5645) 205 628 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dumb
Brendan P. Caulfield wrote: this is dumb. can we just ignore this and move. we are all smart enough to block his posts. let's just do it and quit wasting all of our time and get back to doing what we do here. Actually, some of us don't check mail from this list until the evenings. By the time I'm receiving the 1000 messages from my public email addresses, it's far too late to create a filter. He may as well consider his email address useless now. I don't think many people will hesitate to subscribe him to every ounce of spam they can. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dumb guy needs smart answer
I get the following error statement from a PHP insert I am trying at http://www.solomonsporch.org/test.php Warning: Failed opening 'http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4' for inclusion (include_path='c:\php4\pear') in e:\solomonsporch.org\test.php on line 12 I really don't know what I am doing -- but would sure appreciate getting this working. My host seems to be all set up. Thanks for your time! -Doug
Re: [PHP] dumb guy needs smart answer
It can't find the file you asked to include on line 12 of test.php. Post the code and we may be able to pin-point it. The first half of the error is to do with the default include path... in addition to the include path you set with include(), there is a default that PHP also checks (in your case, c:\php4\pear), which is set in php.ini. Justin French on 06/06/02 4:22 PM, Doug ([EMAIL PROTECTED]) wrote: I get the following error statement from a PHP insert I am trying at http://www.solomonsporch.org/test.php Warning: Failed opening 'http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4' for inclusion (include_path='c:\php4\pear') in e:\solomonsporch.org\test.php on line 12 I really don't know what I am doing -- but would sure appreciate getting this working. My host seems to be all set up. Thanks for your time! -Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb question on terminology
Some arrays use the format: $row-data while some use: $row['data'] What is the terminology of these types so I sound like I know what I'm talking about. Also, when and how do each come about? Dean
RE: [PHP] Dumb question on terminology
In a nutshell: $row-data is referring to an object, not an array, that has an attribute of $data $row['data'] is an associative array - ie, indexes are non-numerical - with an index of data Martin -Original Message- From: Dean Householder [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Dumb question on terminology Some arrays use the format: $row-data while some use: $row['data'] What is the terminology of these types so I sound like I know what I'm talking about. Also, when and how do each come about? Dean
[PHP] dumb mysql_connect issue
Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? ?php $connection = mysql_connect(hostname,username,password) or die (Couldn't connect to server); $db = mysql_select_db(database, $connection) or die (Couldn't select database); $sql = SELECT * FROM table_name.column_name1, table_name.column_name2; $sql_result = mysql_query($sql,$connection) or die (Couldn't execute query); ? Thanks in advance. This mailing list rules!!! __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.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] dumb mysql_connect issue
CGI GUY wrote: Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? What does it say? Any errors? Are any of your messages printed? regards Wagner -- Madness takes its toll. Please have exact change. -- 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] dumb mysql_connect issue
Try putting mysql_error() in your die statements so : or die(mysql_error()); and see what it tells you. Regards, Philip On Tue, 31 Jul 2001, CGI GUY wrote: Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? ?php $connection = mysql_connect(hostname,username,password) or die (Couldn't connect to server); $db = mysql_select_db(database, $connection) or die (Couldn't select database); $sql = SELECT * FROM table_name.column_name1, table_name.column_name2; $sql_result = mysql_query($sql,$connection) or die (Couldn't execute query); ? Thanks in advance. This mailing list rules!!! __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.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]
Re: [PHP] dumb mysql_connect issue
or, echo $sql and copy/paste it into an sql client and see what it tells you. on 7/31/01 4:21 PM, Philip Olson at [EMAIL PROTECTED] wrote: Try putting mysql_error() in your die statements so : or die(mysql_error()); and see what it tells you. Regards, Philip On Tue, 31 Jul 2001, CGI GUY wrote: Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? -- mike cullerton -- 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] dumb mysql_connect issue
on 7/31/01 4:10 PM, CGI GUY at [EMAIL PROTECTED] wrote: Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? snip in FROM table_name.column_name1,table_name.column_name2 table_name.column_name1 is a column, but FROM expects a table. try select table_name.column_name1,table_name.column_name2 from table_name -- mike cullerton -- 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]
Fwd: Re: [PHP] dumb mysql_connect issue
Okay, well I used the mysql_error() print-out, and it returned something weird: Access denied for user: 'username@hostname' to database 'tablename' This is incongruous because: 1. The uid/password set I am using has full privileges. 2. *tablename* is not a database (the code I listed in my previous email is syntactically identical to the script)-- it's a table. Why is this happening to me?!?! ;) Note: forwarded message attached. __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ or, echo $sql and copy/paste it into an sql client and see what it tells you. on 7/31/01 4:21 PM, Philip Olson at [EMAIL PROTECTED] wrote: Try putting mysql_error() in your die statements so : or die(mysql_error()); and see what it tells you. Regards, Philip On Tue, 31 Jul 2001, CGI GUY wrote: Is there anything (add. parameters, etc.) that I'm missing that would possibly explain why the following code won't execute? -- mike cullerton -- 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: Fwd: Re: [PHP] dumb mysql_connect issue
CGI GUY wrote: Access denied for user: 'username@hostname' to database 'tablename' 1. The uid/password set I am using has full privileges. 2. *tablename* is not a database (the code I listed in my previous email is syntactically identical to the script)-- it's a table. Why is this happening to me?!?! ;) FROM table_name.column_name is interpreted as FROM database.table_name Hence the confusion of database and table-names. FROM table_name will suffice. regards Wagner -- Madness takes its toll. Please have exact change. -- 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: Re: [PHP] dumb mysql_connect issue
Is the error coming from a mysql_query() line or a mysql_select_db() line? Data Driven Design P.O. Box 1084 Holly Hill, Florida 32125-1084 http://www.datadrivendesign.com http://www.rossidesigns.net - Original Message - From: CGI GUY [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 6:47 PM Subject: Fwd: Re: [PHP] dumb mysql_connect issue Okay, well I used the mysql_error() print-out, and it returned something weird: Access denied for user: 'username@hostname' to database 'tablename' This is incongruous because: 1. The uid/password set I am using has full privileges. 2. *tablename* is not a database (the code I listed in my previous email is syntactically identical to the script)-- it's a table. Why is this happening to me?!?! ;) Note: forwarded message attached. __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.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] Dumb newbie graphics question
howdy, im new at this, so sorry if this is a dumb question... I want to make some dynamically generated buttons, but even when i copy the most basic of graphics scripts i can find out there, they dont seem to be working. Does this mean my ISP is not configured for displaying PHP generated graphics? thanks for your help "Men never do evil so completely and cheerfully as when they do it from mistaken conviction." Blaise Pascal http://assortedmonkeys.org/
RE: [PHP] Dumb newbie graphics question
im new at this, so sorry if this is a dumb question... I want to make some dynamically generated buttons, but even when i copy the most basic of graphics scripts i can find out there, they dont seem to be working. Does this mean my ISP is not configured for displaying PHP generated graphics? That's possible. You might like to try manually downloading the file using a utility like wget or curl. This will show you if PHP is outputting any errors (which would thus result in a broken image). Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair! -- 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] Dumb newbie graphics question
darthzeth wrote: howdy, im new at this, so sorry if this is a dumb question... I want to make some dynamically generated buttons, but even when i copy the most basic of graphics scripts i can find out there, they dont seem to be working. Does this mean my ISP is not configured for displaying PHP generated graphics? thanks for your help "Men never do evil so completely and cheerfully as when they do it from mistaken conviction." Blaise Pascal http://assortedmonkeys.org/ run phpinfo() and see if it has been compiled with gd support ~jack -- 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] Dumb newbie graphics question
like i said, im a newbie... how do i run phpinfo() ? my almost exclusive experience is with FTPing html pages and a few PHP scripts to the server, other than that, i dont know much. is there any FAQ you can point me to with answer to absolute newbie questions like these? - Original Message - darthzeth wrote: howdy, im new at this, so sorry if this is a dumb question... I want to make some dynamically generated buttons, but even when i copy the most basic of graphics scripts i can find out there, they dont seem to be working. Does this mean my ISP is not configured for displaying PHP generated graphics? thanks for your help "Men never do evil so completely and cheerfully as when they do it from mistaken conviction." Blaise Pascal http://assortedmonkeys.org/ run phpinfo() and see if it has been compiled with gd support ~jack -- 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] Dumb newbie graphics question
From: "darthzeth" [EMAIL PROTECTED] like i said, im a newbie... how do i run phpinfo() ? my almost exclusive experience is with FTPing html pages and a few PHP scripts to the server, other than that, i dont know much. is there any FAQ you can point me to with answer to absolute newbie questions like these? Create a new file called test.php and in it put: ?php phpinfo(); ? FTP it to your web server and then look at it in your browser. It should tell you a whole lot of stuff about how PHP has been configured on your server. Regards Simon Garner -- 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] Dumb newbie graphics question
create a file called phpinfo.php and add to that file ? php_info(); ? then load up that page in your browser. In regards to FAQ's visit www.php.net should also look at phpbuilder.com and there are many more. On php.net in the links section they have even more links to FAQ's John Ashton [EMAIL PROTECTED] The Data Source Network http://www.thedatasource.net -Original Message- From: darthzeth [mailto:[EMAIL PROTECTED]] Sent: March 2, 2001 12:37 AM To: Jack Dempsey Cc: PHP general mailing list Subject: Re: [PHP] Dumb newbie graphics question like i said, im a newbie... how do i run phpinfo() ? my almost exclusive experience is with FTPing html pages and a few PHP scripts to the server, other than that, i dont know much. is there any FAQ you can point me to with answer to absolute newbie questions like these? - Original Message - darthzeth wrote: howdy, im new at this, so sorry if this is a dumb question... I want to make some dynamically generated buttons, but even when i copy the most basic of graphics scripts i can find out there, they dont seem to be working. Does this mean my ISP is not configured for displaying PHP generated graphics? thanks for your help "Men never do evil so completely and cheerfully as when they do it from mistaken conviction." Blaise Pascal http://assortedmonkeys.org/ run phpinfo() and see if it has been compiled with gd support ~jack -- 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 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]