Re: [PHP] undefined variable
isset always returns 0 i create dynamic textbox called quantity0, textbox1, textbox3... then i a, trying to get the content of the textbox but it is always 0. as you can see, i tried the suggestions but it still dont work. is there something iam doing wroing? why is the textbox always 0? New row number: name of textbox: " TEST ""Richard Lynch"" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > On Sat, April 29, 2006 5:42 am, Smart Software wrote: >> code below shows all records from products table with an textbox and >> an >> order button for each record > >> How can i add the content of the textbox? >> i tried this: >> > ?>"> >> >> but all i get is an error telling me there is a undefined varable > > You probably are following some kind of tutorial that assumes > "register_globals" is "on" -- or you are simply used to that > environment. > > So when you try to use $quantity, it's not defined. > > The value you want is in $_REQUEST['quantity']; > > You should do something like this: > > //Get data from REQUEST: > $quantity = isset($_REQUEST['quantity']) ? $_REQUEST['quantity'] : 0; > //Force valid data: > $quantity = (int) $quantity; > //rest of script here. > ?> > > -- > 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] undefined variable
On Sat, April 29, 2006 5:42 am, Smart Software wrote: > code below shows all records from products table with an textbox and > an > order button for each record > How can i add the content of the textbox? > i tried this: > ?>"> > > but all i get is an error telling me there is a undefined varable You probably are following some kind of tutorial that assumes "register_globals" is "on" -- or you are simply used to that environment. So when you try to use $quantity, it's not defined. The value you want is in $_REQUEST['quantity']; You should do something like this: -- 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] undefined variable
> 2006/4/29, Smart Software <[EMAIL PROTECTED]>: > How can i add the content of the textbox? > i tried this: > ?>"> > > but all i get is an error telling me there is a undefined varable It looks like you're trying to get at $quantity, but have you pulled it from the submitted form yet? If your form's method is "post" then reference the quantity value with $_POST['quantity']; if your form's method is "get", use $_GET['quantity']. You sound very new to this, and the fact that you're building a shopping cart is worrisome...so please read up on the importance of verifying your form data, i.e. always "sanitize" submitted values before using them in SQL calls. And simply check that the values you get are what you expect, i.e. if you're expecting a number in $_POST['quantity'], make sure it's a number... By the way, values submitted in a form will be strings, so in the example above you'd actually be checking for the *existence of numbers only* in the string. Good luck. HTH, John W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable
2006/4/29, Smart Software <[EMAIL PROTECTED]>: code below shows all records from products table with an textbox and an order button for each record "> if someone presses the button, an item will be ordered. How can i add the content of the textbox? i tried this: "> but all i get is an error telling me there is a undefined varable Can you post what the error looks like? thanx for all help N. Karademir -- PHP General Mailing List ( http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined Variable Problems...
Sorry if this has been covered before. I just joined this list. My host just upgraded PHP to 4.3.10 from 4.1.2. A couple of my clients are using systems such as PHP-NUKE or various message boards. I hadn't been paying attention to my log files, but all of a sudden they got huge, especially the error logs. They're filled mostly with undefined variable errors, but also a couple others, for example: [Sun Mar 6 00:35:50 2005] [error] PHP Notice: Undefined variable: forum_admin in /home/scott/.org/html/mainfile.php on line 79 [Sun Mar 6 00:35:51 2005] [error] PHP Notice: Undefined offset: 1 in /home/scott/.org/html/mainfile.php on line 486 [Sun Mar 6 00:35:51 2005] [error] PHP Notice: Undefined index: 2 in /home/scott/.org/html/mainfile.php on line 216 line 79, if ($forum_admin == 1) { line 486, $uname = $cookie[1]; line 216, $pwd = "$user[2]"; Line 79 is not part of a function or class. It is the first reference to $forum_admin in the script. The other two are within functions and the first call within those functions. What's being assigned to both of them are either in the function call itself or globals. I do have globals turned on. Should I worry about any of this? The pages seem to be working fine? Is this going to slow things down? Should I just turn off the logging of such errors, if I can? Thanks for any help. My log files are in the gigabytes with 90% of that over the last month. Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNDEFINED VARIABLE ON LOCALHOST
It was my error reporting.forgot I replaced my ini file. "John Nichel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ross Hulford wrote: >> I have a porblem with undefined variables on loacalhost. Any ideas why? I >> have turned registed variables on. >> >> >> R. > > Without seeing any code, I'm going to guess that you haven't defined a > variable before trying to use it. Wanna make it go away? Turn off > 'notices' in your error reporting, or make sure your variables are defined > before you try to use them. > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNDEFINED VARIABLE ON LOCALHOST
On Mon, 29 Nov 2004 17:11:47 -, Ross Hulford <[EMAIL PROTECTED]> wrote: > I have a porblem with undefined variables on loacalhost. Any ideas why? I > have turned registed variables on. Where's the code? -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNDEFINED VARIABLE ON LOCALHOST
Ross Hulford wrote: I have a porblem with undefined variables on loacalhost. Any ideas why? I have turned registed variables on. R. Without seeing any code, I'm going to guess that you haven't defined a variable before trying to use it. Wanna make it go away? Turn off 'notices' in your error reporting, or make sure your variables are defined before you try to use them. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UNDEFINED VARIABLE ON LOCALHOST
I have a porblem with undefined variables on loacalhost. Any ideas why? I have turned registed variables on. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Undefined variable using hyperlink
Hello, Wednesday, December 10, 2003, 5:45:17 PM, you wrote: >> $msgid = $_GET['msgid']; P> That seems to have corrected the problem. Thank you very much. Cool - do you understand why though? I don't mean to sound patronising, so please don't take offence at my question, just making sure. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable using hyperlink
That seems to have corrected the problem. Thank you very much. On 12/10/03 11:56 AM, "Richard Davey" <[EMAIL PROTECTED]> wrote: > Hello, > > Wednesday, December 10, 2003, 4:53:18 PM, you wrote: > > P> I can retrieve email from the email account, but when I click on a link in > P> the email.php to open the email in body.php, $msgid is not defined in > P> body.php. It's got to be something basic, but right now, it escapes me. > P> Right now this is running on my Windows 2000 Pro machine. > > At the start of body.php try adding this: > > $msgid = $_GET['msgid']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable using hyperlink
Hello, Wednesday, December 10, 2003, 4:53:18 PM, you wrote: P> I can retrieve email from the email account, but when I click on a link in P> the email.php to open the email in body.php, $msgid is not defined in P> body.php. It's got to be something basic, but right now, it escapes me. P> Right now this is running on my Windows 2000 Pro machine. At the start of body.php try adding this: $msgid = $_GET['msgid']; -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined variable using hyperlink
I'm having some basic problems with the following pages, index.php (frames base), email.php, and body.php. I can retrieve email from the email account, but when I click on a link in the email.php to open the email in body.php, $msgid is not defined in body.php. It's got to be something basic, but right now, it escapes me. Right now this is running on my Windows 2000 Pro machine. Any help would be appreciated. Thank you in advance. Chuck Index.php Email.php Email Test Body, TR, TD, Table { color : Black; font : 11px Arial, Helvetica, sans-serif; } From Subject Date Nmsgs; $overview = imap_fetch_overview($mbox, "1:$mnum", 0); $headers = imap_headers ($mbox); // Data Table $nbm = sizeof($overview); for($x= $nbm-1; $x >= 0; $x--) { $val=$overview[$x]; $nb = $val->msgno; $sFrom =$val->from; $sSubject = $val->subject; if($sSubject == '') { $sSubject = "No Subject Included"; } $dDate=$val->date; // Inbox Output print " $sFrom $sSubject $dDate "; } imap_close($mbox); ?> Body.php New Document subject); $msubject=$rawsubject[0]->text; $mfrom=htmlspecialchars(str_replace("\"","",$mailheader->fromaddress)); $mto=htmlspecialchars(str_replace("\"","",$mailheader->toaddress)); $mcc=htmlspecialchars(str_replace("\"","",$mailheader->ccaddress)); $mreply=$mailheader->reply_toaddress; $mdate=$mailheader->Date; $mailcheck = imap_check($mbox); $mailnumber = $mailcheck->Nmsgs; // Get the structure of the email $structure = imap_fetchstructure($mbox,$msgid); /* if (isset($msgid)) { //$msgid = "$msgid"; } if (empty($msgid)) { //$mnum = $mcheck->Nmsgs; //$msgid = "$mnum"; } */ imap_close($mbox); ?> -- End of Forwarded Message -- End of Forwarded Message -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable
did you solve this problem? i checked the coding in my linux box, it's working fine. Viraj Chris Kay wrote: > > You seem confused with POST & GET, instead of using _POST to retrieve > values from the form, you use $senders_name, and further down you set > $_POST["msg"], which will only be used in the same php code on the same > page > > Try > > $msg = "Sender's Full Name:\t" . $_POST['sender_name'] . "\n"; > $msg .="Sender's E-mail:\t" . $_POST['sender_email'] . "\n"; > $msg .="Did you like the site?\t" . $_POST['like_site'] . "\n"; > $msg .="Additional Message:\t" . $_POST['message'] . "\n\n"; > > $mailheaders = "From: yoyo.monash.edu.my\~nthonyak\M\n"; > $mailheaders .="Reply-To: " . $_POST['sender_email'] . "\n\n"; > > mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); > > -- > Chris Kay (CK) > Eleet Internet Services > M: 0415 451 372 > P: 02 4620 5076 > F: 02 4620 7008 > E: [EMAIL PROTECTED] > > -Original Message- > From: merryE [mailto:[EMAIL PROTECTED] > Sent: Friday, 29 August 2003 2:38 AM > To: [EMAIL PROTECTED] > Subject: [PHP] undefined variable > > Can anyone tell me what's wrong with my code? I tried to create a form > in html and redirect it to php. but result said: > Notice: Undefined variable: sender_name in c:\program files\apache > group\apache\htdocs\do_feedback.php on line 2 and for all the variables > ("sender_email", "like_site", and "text area"). > I have been tring to use variable but it is always said "Undefined > variable". > Please help, Thanks. > > This is the code for form > > > your name: > your email: > Did you like the site? > yes > no > > Additional message: > > > > > > Code for php: > $_POST["msg"] = "Sender's Full Name:\t$sender_name\n"; > $_POST["msg"] .="Sender's E-mail:\t$sender_email\n"; > $_POST["msg"] .="Did you like the site?\t$like_site\n"; > $_POST["msg"] .="Additional Message:\t$message\n\n"; > > $_POST["mailheaders"] = "From: yoyo.monash.edu.my\~nthonyak\M\n"; > $_POST["mailheaders"] .="Reply-To: $sender_email\n\n"; > > mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); > > echo $_POST["sender_name"]; > echo "We appreciate your feedback"; > ?> > > -- > 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] undefined variable
You seem confused with POST & GET, instead of using _POST to retrieve values from the form, you use $senders_name, and further down you set $_POST["msg"], which will only be used in the same php code on the same page Try $msg = "Sender's Full Name:\t" . $_POST['sender_name'] . "\n"; $msg .="Sender's E-mail:\t" . $_POST['sender_email'] . "\n"; $msg .="Did you like the site?\t" . $_POST['like_site'] . "\n"; $msg .="Additional Message:\t" . $_POST['message'] . "\n\n"; $mailheaders = "From: yoyo.monash.edu.my\~nthonyak\M\n"; $mailheaders .="Reply-To: " . $_POST['sender_email'] . "\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); -- Chris Kay (CK) Eleet Internet Services M: 0415 451 372 P: 02 4620 5076 F: 02 4620 7008 E: [EMAIL PROTECTED] -Original Message- From: merryE [mailto:[EMAIL PROTECTED] Sent: Friday, 29 August 2003 2:38 AM To: [EMAIL PROTECTED] Subject: [PHP] undefined variable Can anyone tell me what's wrong with my code? I tried to create a form in html and redirect it to php. but result said: Notice: Undefined variable: sender_name in c:\program files\apache group\apache\htdocs\do_feedback.php on line 2 and for all the variables ("sender_email", "like_site", and "text area"). I have been tring to use variable but it is always said "Undefined variable". Please help, Thanks. This is the code for form your name: your email: Did you like the site? yes no Additional message: Code for php: We appreciate your feedback"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined variable
Can anyone tell me what's wrong with my code? I tried to create a form in html and redirect it to php. but result said: Notice: Undefined variable: sender_name in c:\program files\apache group\apache\htdocs\do_feedback.php on line 2 and for all the variables ("sender_email", "like_site", and "text area"). I have been tring to use variable but it is always said "Undefined variable". Please help, Thanks. This is the code for form your name: your email: Did you like the site? yes no Additional message: Code for php: We appreciate your feedback"; ?>
Re: [PHP] Undefined variable problem
* Thus wrote Ryan A ([EMAIL PROTECTED]): > > Notice: Undefined variable: email1 in c:\phpdev\www\bwh\project\compare.php > on line 117 > [...] > >$m = 1; >while ($line = mysql_fetch_assoc($rs)) { //dumping into an array > foreach ($line as $field => $value) { > $tmp = $field.$m; > $$tmp.= $value; /* This is the error line 117*** */ Your concating a variable that doesnt exist. Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable problem
IT WORKS!!! Thanks for replying and the solution. Cheers, -Ryan Hello, This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at 14:47, lines prefixed by '>' were originally written by you. > Notice: Undefined variable: email1 in > c:phpdevwwwbwhprojectcompare.php > on line 117 > $$tmp.= $value; /* This is the error line 117*** */ You are trying to append to the variable instead of create it, change this line to: $$tmp = $value; David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable problem
Hello This is the code: $m = 1; while ($line = mysql_fetch_assoc($rs)) { //dumping into an array foreach ($line as $field => $value) { $tmp = $field.$m; $$tmp.= $value; /* This is the error line 117*** */ } $m++; } This is basically so that i can use the array via variables like so: if($tcl2==1){echo $tcl2;} instead of: if($arrayname['tcl']['1']==1){echo $arrayname['tcl']['1'];} and so onesp since i have 38 fields. I can of course just shut off error reporting...but thats not the best solution right? and i still wouldnt know whats causing these notices... Simply define $$tmp -variable before adding stuff in it. [code] $m = 1; while ($line = mysql_fetch_assoc($rs)) { //dumping into an array foreach ($line as $field => $value) { $tmp = $field.$m; $$tmp = ""; $$tmp .= $value; } $m++; } [/code] No it should whine about undefined vars. Cheers, Joona -- Joona Kulmala <[EMAIL PROTECTED]> PHP Finland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable problem
Hello, This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at 14:47, lines prefixed by '>' were originally written by you. > Notice: Undefined variable: email1 in > c:phpdevwwwbwhprojectcompare.php > on line 117 > $$tmp.= $value; /* This is the error line 117*** */ You are trying to append to the variable instead of create it, change this line to: $$tmp = $value; David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined variable problem
Hi, This is the following code given to me by Jenniffer Goodie (thank you) which is working great but is throwing this notice: Notice: Undefined variable: email1 in c:\phpdev\www\bwh\project\compare.php on line 117 Notice: Undefined variable: address1 in c:\phpdev\www\bwh\project\compare.php on line 117 Notice: Undefined variable: city1 in c:\phpdev\www\bwh\project\compare.php on line 117 etc (30+ notices) This is the code: $m = 1; while ($line = mysql_fetch_assoc($rs)) { //dumping into an array foreach ($line as $field => $value) { $tmp = $field.$m; $$tmp.= $value; /* This is the error line 117*** */ } $m++; } This is basically so that i can use the array via variables like so: if($tcl2==1){echo $tcl2;} instead of: if($arrayname['tcl']['1']==1){echo $arrayname['tcl']['1'];} and so onesp since i have 38 fields. I can of course just shut off error reporting...but thats not the best solution right? and i still wouldnt know whats causing these notices... Any ideas? Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined variable: action
> -Original Message- > From: Ryan M [mailto:[EMAIL PROTECTED] > Sent: 11 June 2003 20:22 > > Thanks for the advice... The link worked Now it is saying this: > > Notice: Undefined index: action in > > It only says this if there is no action...it goes away once I > click the link > and the action=someaction Is there a way to fix my php Simplest way to fix this is to use the @ silence operator: @$_GET['action'] will return NULL if $_GET['action'] is undefined. > so > that I dont > have to change all of the web sites hosted on my server?? Thanks! The only way to do that is to reduce the error reporting level to not include E_NOTICE. Ideally, you should run a development server which has error reporting set to E_ALL, and only copy scripts to your production server once they produce no messages at this level -- your production server can then run with a reduced error reporting level (even down to none at all, if you feel confident about that ;). Ideally, if your production server does run with no error reporting, you should have error logging enabled as a safety net! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable: action
On Wed, 2003-06-11 at 13:40, Mark wrote: > Or you can simply turn off NOTICE error reporting in the php.ini file > or use ini_set or error_reporting() to not include notices. This > should not affect functionality. That's not a good idea; it's treating the symptom, not the problem. A better idea is to crank up error reporting all the way on your dev box, write your code so that it doesn't generate any NOTICES etc, and then turn off display_errors on the production box. It's a good idea to log the errors or write a handler or something for when errors aren't being displayed. -- Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable: action
Or you can simply turn off NOTICE error reporting in the php.ini file or use ini_set or error_reporting() to not include notices. This should not affect functionality. --- Lars Torben Wilson <[EMAIL PROTECTED]> wrote: > On Wed, 2003-06-11 at 12:22, Ryan M wrote: > > Thanks for the advice... The link worked Now it is saying > this: > > > > Notice: Undefined index: action in > > > > It only says this if there is no action...it goes away once I > click the link > > and the action=someaction Is there a way to fix my php so > that I dont > > have to change all of the web sites hosted on my server?? Thanks! > > > > Ryan > > Check and initialize your input variables: > > if (!isset($_GET['action'])) { > $action = ''; > } else { > $action = $_GET['action']; > } > > switch ($action) { > case 'something': >do_something(); > break; > case 'something_else': >do_something_else(); > break; > default: >echo "Unrecognized action given"; > break; > } > > If this is something you need to do for every page on your site, > put > the if() check into an auto-prepended file or something. > > > Hope this helps, > > Torben > > > -- > Torben Wilson <[EMAIL PROTECTED]> > +1.604.709.0506 > http://www.thebuttlesschaps.com > http://www.inflatableeye.com > http://www.hybrid17.com > http://www.themainonmain.com > - Boycott Starbucks! http://www.haidabuckscafe.com > - > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable: action
On Wed, 2003-06-11 at 12:22, Ryan M wrote: > Thanks for the advice... The link worked Now it is saying this: > > Notice: Undefined index: action in > > It only says this if there is no action...it goes away once I click the link > and the action=someaction Is there a way to fix my php so that I dont > have to change all of the web sites hosted on my server?? Thanks! > > Ryan Check and initialize your input variables: if (!isset($_GET['action'])) { $action = ''; } else { $action = $_GET['action']; } switch ($action) { case 'something': do_something(); break; case 'something_else': do_something_else(); break; default: echo "Unrecognized action given"; break; } If this is something you need to do for every page on your site, put the if() check into an auto-prepended file or something. Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined variable: action
[snip] Thanks for the advice... The link worked Now it is saying this: Notice: Undefined index: action in It only says this if there is no action...it goes away once I click the link and the action=someaction Is there a way to fix my php so that I dont have to change all of the web sites hosted on my server?? Thanks! [/snip] There are some caveats, but change register_globals to 'on' in php.ini and then go read about register globals on the php sitethere are some things to condsider about the security vulnerability of certain variables; Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable: action
Thanks for the advice... The link worked Now it is saying this: Notice: Undefined index: action in It only says this if there is no action...it goes away once I click the link and the action=someaction Is there a way to fix my php so that I dont have to change all of the web sites hosted on my server?? Thanks! Ryan "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] Hows it goin?? Im pretty new to this, so I have a pretty simple question. I am running an apache server with php 4 on a win 2k machine. When I try to do something like this: Some Action"; if ($action == "someaction") { echo "Anything"; } ?> It says: Notice: Undefined variable: action in . Ive built plenny of pages with simple things like that, and they all work...is it a problem with my apache server??? Thanks in advance [/snip] You probably updated PHP recently and register_globals is now 'off'. Try if($_GET['action'] == "someaction"){ do foo } HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined variable: action
[snip] Hows it goin?? Im pretty new to this, so I have a pretty simple question. I am running an apache server with php 4 on a win 2k machine. When I try to do something like this: Some Action"; if ($action == "someaction") { echo "Anything"; } ?> It says: Notice: Undefined variable: action in . Ive built plenny of pages with simple things like that, and they all work...is it a problem with my apache server??? Thanks in advance [/snip] You probably updated PHP recently and register_globals is now 'off'. Try if($_GET['action'] == "someaction"){ do foo } HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined variable: action
Hows it goin?? Im pretty new to this, so I have a pretty simple question. I am running an apache server with php 4 on a win 2k machine. When I try to do something like this: Some Action"; if ($action == "someaction") { echo "Anything"; } ?> It says: Notice: Undefined variable: action in . Ive built plenny of pages with simple things like that, and they all work...is it a problem with my apache server??? Thanks in advance Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable notice - how to furn of
or give error_reporting(0); in the start of the file "Joseph W. Goff" <[EMAIL PROTECTED]> wrote in message 002601c2b803$26a67110$bdcaa8c0@jg42000">news:002601c2b803$26a67110$bdcaa8c0@jg42000... > In the php.ini file set error reporting to E_ALL & ~E_NOTICE > > - Original Message - > From: "Borut Kovacec" <[EMAIL PROTECTED]> > To: "PHP Mailing List" <[EMAIL PROTECTED]> > Sent: Thursday, January 09, 2003 9:57 AM > Subject: [PHP] undefined variable notice - how to furn of > > > Hi > > I just installed new php 4.2.3 on Win XP, Apache 1.3.24.. > Everything works fine, just now I'm getting "Notice" messages for every > undefined variable or undefined index in arrays.. > > So now I have to use issset() everytime to avoid this messages... > > ..is there any way to turn this messages off, because if prior versions I > never got them..?? > > Borut > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined variable notice - how to furn of
In the php.ini file set error reporting to E_ALL & ~E_NOTICE - Original Message - From: "Borut Kovacec" <[EMAIL PROTECTED]> To: "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 9:57 AM Subject: [PHP] undefined variable notice - how to furn of Hi I just installed new php 4.2.3 on Win XP, Apache 1.3.24.. Everything works fine, just now I'm getting "Notice" messages for every undefined variable or undefined index in arrays.. So now I have to use issset() everytime to avoid this messages... ..is there any way to turn this messages off, because if prior versions I never got them..?? Borut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined variable notice - how to furn of[Scanned]
Borut, I had this problem myself just before Christmas. The following solution was proposed: >> All of the PHP scripts hosted on a Linux server >> I'm working with have suddenly begun producing >> an error message: >> >> undefined variable 'variablename' > Looks like someone's tweaked the error reporting level so it's on E_ALL, > which can be a somewhat alarmist setting :-) > Read all about it at http://php.net/manual/en/ref.errorfunc.php Michael Egan -Original Message- From: Borut Kovacec [mailto:[EMAIL PROTECTED]] Sent: 09 January 2003 15:57 To: PHP Mailing List Subject: [PHP] undefined variable notice - how to furn of[Scanned] Hi I just installed new php 4.2.3 on Win XP, Apache 1.3.24.. Everything works fine, just now I'm getting "Notice" messages for every undefined variable or undefined index in arrays.. So now I have to use issset() everytime to avoid this messages... ..is there any way to turn this messages off, because if prior versions I never got them..?? Borut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined variable notice - how to furn of
Hi I just installed new php 4.2.3 on Win XP, Apache 1.3.24.. Everything works fine, just now I'm getting "Notice" messages for every undefined variable or undefined index in arrays.. So now I have to use issset() everytime to avoid this messages... ..is there any way to turn this messages off, because if prior versions I never got them..?? Borut
RE: [PHP] Undefined variable error message[Scanned]
Jon, Many thanks - the actual problem is now solved. As to how it occurred I think must be attributable to me at some stage in terms of fiddling around with the php.ini file. Perhaps I've had too many nights like last night and the brain cells are depleting past a critical point! Thanks to everybody else who responded to this query. Michael Egan -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 10:39 To: Michael Egan; PHP General (E-mail) Subject: RE: [PHP] Undefined variable error message[Scanned] Hi Michael, > All of the PHP scripts hosted on a Linux server > I'm working with have suddenly begun producing > an error message: > > undefined variable 'variablename' Looks like someone's tweaked the error reporting level so it's on E_ALL, which can be a somewhat alarmist setting :-) Read all about it at http://php.net/manual/en/ref.errorfunc.php > The latter would suggest fairly significant > security issues. Does anybody have any ideas > as to how this might have occurred Are you on a shared host, or is there someone else who admins your box? If so, have a word with them and see if they've been fiddling with php.ini - that's where the error reporting level is set. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable error message
Hmm, yes. Why did I not think of error reporting at E_ALL? Chris Hewitt wrote: Michael Egan wrote: All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message: undefined variable 'variablename' Has the code been working on a different server with an earlier version of PHP (or this server upgraded)? It sounds as though it needs register_globals in php.ini turned on, or the code modified to use the $_GET and $_POST super globals. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable error message
Michael Egan wrote: All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message: undefined variable 'variablename' Has the code been working on a different server with an earlier version of PHP (or this server upgraded)? It sounds as though it needs register_globals in php.ini turned on, or the code modified to use the $_GET and $_POST super globals. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined variable error message
Hi Michael, > All of the PHP scripts hosted on a Linux server > I'm working with have suddenly begun producing > an error message: > > undefined variable 'variablename' Looks like someone's tweaked the error reporting level so it's on E_ALL, which can be a somewhat alarmist setting :-) Read all about it at http://php.net/manual/en/ref.errorfunc.php > The latter would suggest fairly significant > security issues. Does anybody have any ideas > as to how this might have occurred Are you on a shared host, or is there someone else who admins your box? If so, have a word with them and see if they've been fiddling with php.ini - that's where the error reporting level is set. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable error message
http://www.php.net/manual/en/function.error-reporting.php At 10:31 18-12-02 +, Michael Egan wrote: All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message: undefined variable 'variablename' This occurs wherever a variable name is referred to. I'm concerned about this for two reasons: 1 Will I have to go through each script making substantial alterations? 2 Has the configuration of PHP been altered in some way without my knowledge? The latter would suggest fairly significant security issues. Does anybody have any ideas as to how this might have occurred and the quickest way of resolving it? Or of links to possible solutions? This is particularly irritating as last night was the office Christmas party and I'm in a rather fragile state this morning :-( Michael Egan -- 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] Undefined variable error message
All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message: undefined variable 'variablename' This occurs wherever a variable name is referred to. I'm concerned about this for two reasons: 1 Will I have to go through each script making substantial alterations? 2 Has the configuration of PHP been altered in some way without my knowledge? The latter would suggest fairly significant security issues. Does anybody have any ideas as to how this might have occurred and the quickest way of resolving it? Or of links to possible solutions? This is particularly irritating as last night was the office Christmas party and I'm in a rather fragile state this morning :-( Michael Egan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined Variable
Marco Tabini <[EMAIL PROTECTED]> wrote in message: > Hey Anthony-- > > It's definitely a register_globals problem. Your ISP has turned it off > because it's generally considered a significant security risk. > > The best way to solve it is to use the superglobal $_POST to access your > post data. In your PHP script, change all the variables that you take > from the form into their $_POST[''] equivalent (see below for a rough > example--I put the assignments at the beginning because I wanted to > touch your code as little as possible). Also, keep in mind that you're > not performing any checks on the data--I'm sure you want to do it once > you've sorted the current problem out, but the way it is now you're > leaving yourself exposed to a number of possible attacks. > > $thename = $_POST['thename']; (snipped) . Yep. That did it. Thanks again Marco. Two more questions: 1. Can you give me some examples about: "leaving yourself exposed to a number of possible attacks." and 2. Where can I pick up the PHP magazine in your post sig. best... TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined Variable
Hey Anthony-- It's definitely a register_globals problem. Your ISP has turned it off because it's generally considered a significant security risk. The best way to solve it is to use the superglobal $_POST to access your post data. In your PHP script, change all the variables that you take from the form into their $_POST[''] equivalent (see below for a rough example--I put the assignments at the beginning because I wanted to touch your code as little as possible). Also, keep in mind that you're not performing any checks on the data--I'm sure you want to do it once you've sorted the current problem out, but the way it is now you're leaving yourself exposed to a number of possible attacks. $thename = $_POST['thename']; $email = $_POST['email']; $description = $_POST['description']; $bizname = $_POST['bizname']; $contactname = $_POST['contactname']; $phone = $_POST['phone']; $email = $_POST['email']; $mailing = $_POST['mailing']; $town = $_POST['town']; $state = $_POST['state']; $zip = $_POST['zip']; $cat = $_POST['cat']; if (($thename == "") && ($email == "") && ($description == "")) { header("Location: http://localhost/n_proserv_x.html";); exit; } $msg = "This e-mail was sent from:\n"; $msg .= "Sender's Name:$thename\n"; $msg .= $thename ."'s business name is:$bizname\n"; $msg .= "The contact person is:$contactname\n"; $msg .= $thename. "'s phone number is:$phone\n"; $msg .= $thename. "'s e-mail address is: $email\n"; $msg .= $thename. "'s mailing address is: $mailing\n"; $msg .= "Town: $town\n"; $msg .= "State: $state\n"; $msg .= "Zip Code: $zip\n"; $msg .= $thename."'s category is: $cat\n"; $msg .= "and the message is: $description\n\n"; $to = "[EMAIL PROTECTED]"; $subject = "Narrowsburg Chamber of Commerce"; $mailheaders = "From: $thename\n"; $mailheaders .= "Reply to:$email\n\n"; mail($to, $subject, $msg, $mailheaders); ?> -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com! --- Begin Message --- >"Marco Tabini <[EMAIL PROTECTED]> wrote in message: > Best guess, your local server has register_globals on and your ISP > doesn't. However, without seeing your code it's going to be difficult to > tell for sure! :-) > > > Marco Thanks for the reply Marco. The following is the code. Any advice would be greatly appreciated. Happy holidays... Tony //this is the the html page http://www.narrowsburg.org/getform.php"; METHOD="POST"> Your Name: Business Name: Contact Person: Telephone Number: e-mail address: Mailing Address: Town:State: Zip Code: Category: Description of your business: //this is the .php file called "getform.php" http://localhost/n_proserv_x.html";); exit; } $msg = "This e-mail was sent from:\n"; $msg .= "Sender's Name:$thename\n"; $msg .= $thename ."'s business name is:$bizname\n"; $msg .= "The contact person is:$contactname\n"; $msg .= $thename. "'s phone number is:$phone\n"; $msg .= $thename. "'s e-mail address is: $email\n"; $msg .= $thename. "'s mailing address is: $mailing\n"; $msg .= "Town: $town\n"; $msg .= "State: $state\n"; $msg .= "Zip Code: $zip\n"; $msg .= $thename."'s category is: $cat\n"; $msg .= "and the message is: $description\n\n"; $to = "[EMAIL PROTECTED]"; $subject = "Narrowsburg Chamber of Commerce"; $mailheaders = "From: $thename\n"; $mailheaders .= "Reply to:$email\n\n"; mail($to, $subject, $msg, $mailheaders); ?> . -- 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] Undefined Variable
>"Marco Tabini <[EMAIL PROTECTED]> wrote in message: > Best guess, your local server has register_globals on and your ISP > doesn't. However, without seeing your code it's going to be difficult to > tell for sure! :-) > > > Marco Thanks for the reply Marco. The following is the code. Any advice would be greatly appreciated. Happy holidays... Tony //this is the the html page http://www.narrowsburg.org/getform.php"; METHOD="POST"> Your Name: Business Name: Contact Person: Telephone Number: e-mail address: Mailing Address: Town:State: Zip Code: Category: Description of your business: //this is the .php file called "getform.php" http://localhost/n_proserv_x.html";); exit; } $msg = "This e-mail was sent from:\n"; $msg .= "Sender's Name:$thename\n"; $msg .= $thename ."'s business name is:$bizname\n"; $msg .= "The contact person is:$contactname\n"; $msg .= $thename. "'s phone number is:$phone\n"; $msg .= $thename. "'s e-mail address is: $email\n"; $msg .= $thename. "'s mailing address is: $mailing\n"; $msg .= "Town: $town\n"; $msg .= "State: $state\n"; $msg .= "Zip Code: $zip\n"; $msg .= $thename."'s category is: $cat\n"; $msg .= "and the message is: $description\n\n"; $to = "[EMAIL PROTECTED]"; $subject = "Narrowsburg Chamber of Commerce"; $mailheaders = "From: $thename\n"; $mailheaders .= "Reply to:$email\n\n"; mail($to, $subject, $msg, $mailheaders); ?> . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined Variable
Best guess, your local server has register_globals on and your ISP doesn't. However, without seeing your code it's going to be difficult to tell for sure! :-) Marco -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com! --- Begin Message --- Using MS Win 98 / Apache Server: I'm trying to test a form box using the php mail() function. All is well when I fill in the text boxes and hit submit. I receive the e-mail. The form action in the html page is: http://localhost/getform.php"; METHOD="POST"> _Now_ when I copy both of those files which are: 1. The html file for the form box - I have now changed the form action to read: http://www.narrowsburg.org/getform.php"; METHOD="POST"> and 2. the .php file for the script and publish them to my site which is hosted on my ISP's MS Server, and then input data in the form boxes and hit submit: I now get the following: .. NOTICE: Undefined Variable: name in d:\inetpub\www.narrowsburg.org\getform.php in line 7 Then, when I check my e-mail I get a message with no input data from the variables like the name, e-mail, address, etc. Thanking all in advance who might help me out. Tony Ritter -- -- 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
[PHP] Undefined Variable
Using MS Win 98 / Apache Server: I'm trying to test a form box using the php mail() function. All is well when I fill in the text boxes and hit submit. I receive the e-mail. The form action in the html page is: http://localhost/getform.php"; METHOD="POST"> _Now_ when I copy both of those files which are: 1. The html file for the form box - I have now changed the form action to read: http://www.narrowsburg.org/getform.php"; METHOD="POST"> and 2. the .php file for the script and publish them to my site which is hosted on my ISP's MS Server, and then input data in the form boxes and hit submit: I now get the following: .. NOTICE: Undefined Variable: name in d:\inetpub\www.narrowsburg.org\getform.php in line 7 Then, when I check my e-mail I get a message with no input data from the variables like the name, e-mail, address, etc. Thanking all in advance who might help me out. Tony Ritter -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined Variable
Hi, I'm with problem: Undefined Variable. I'm using : PHP 4.2.3 MySql 3.2.39 Windows 2000 How do I make to soluction my problem ? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined Variable errors
> I'm migrating to PHP from ColdFusion. > > I've been running some sample scripts I have found in various places and > all > of them throw an error: > > Notice: Undefined variable: in > c:\inetpub\wwwroot\myphpcalendar\ on line . > > In ColdFusion, I can use the tag to preset a variable. I've > tried > the following code to define the variable in PHP, but it doesn't work: > > if (!isset($VarName)) { > $VarName = 0; > } How does that "not work?" It should, as long as you're including the line before the others that are giving you the notice. You can also turn down your error_reporting setting in php.ini. You can turn off notices and just see warnings. There is an example within php.ini. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined Variable errors
Hello, I'm migrating to PHP from ColdFusion. I've been running some sample scripts I have found in various places and all of them throw an error: Notice: Undefined variable: in c:\inetpub\wwwroot\myphpcalendar\ on line . In ColdFusion, I can use the tag to preset a variable. I've tried the following code to define the variable in PHP, but it doesn't work: if (!isset($VarName)) { $VarName = 0; } Is there a setting in php.ini or a call in the beginning of the script that I need to use? Thanks, James Johnson Owell Technologies [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined variable
Try using $_POST['name'] or $_GET['name']. E.g.: Regards, Daniel Kushner _ Need hosting? http://thehostingcompany.us -Original Message- From: Muhammad Khairuzzaman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 8:22 AM To: [EMAIL PROTECTED] Subject: [PHP] Undefined variable I'm trying to process data from a form, regardless whether I'm using GET or POST method, the value that i get in the processed form is still null. I check in the error log file and this is what it say: [Wed Oct 09 20:18:47 2002] [error] PHP Notice: Undefined variable: name in e:\program files\apache group\apache\htdocs\test.php3 on line 3 Or is there something wrong in my code? Or something with my setting? Name: --- -- 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] Undefined variable
I'm trying to process data from a form, regardless whether I'm using GET or POST method, the value that i get in the processed form is still null. I check in the error log file and this is what it say: [Wed Oct 09 20:18:47 2002] [error] PHP Notice: Undefined variable: name in e:\program files\apache group\apache\htdocs\test.php3 on line 3 Or is there something wrong in my code? Or something with my setting? Name: --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable: blabla ?
Hkan wrote: >I just reinstalled the system and everything on my computer, and thought I >should get the latest versions of apache, php and mysql, and now I get this >message everywhere on my pages.. hehe.. :P >how do I "define variables" ? > If you have reinstalled with latest versions, maybe your earlier version had register_globals on. Its off by default in newer versions (see the README with your source). Either turn it on or better, use $var = $_GET['varname'] for GET variables and $var = $_POST['varname'] for POSTED variables. The "undefined" means that you are using a variable before giving it a value. Probably caused by the above, but you may also have errors set at E_ALL. This is good for development as it gives warnings, not just errors. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined variable: blabla ?
I just reinstalled the system and everything on my computer, and thought I should get the latest versions of apache, php and mysql, and now I get this message everywhere on my pages.. hehe.. :P how do I "define variables" ? Håkan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined variable: PHP_SELF
$_SERVER['PHP_SELF'] when globals are off. >How about this: > > > >- Vic > > >-Original Message- >From: Manuel Ochoa [mailto:[EMAIL PROTECTED]] >Sent: Thursday, August 15, 2002 7:20 PM >To: PHP General >Subject: [PHP] Undefined variable: PHP_SELF > > >I keep getting "Undefined variable: PHP_SELF" when using the following: > > > >Global variables are off... What am I doing wrong? > >__ >Post your ad for free now! http://personals.yahoo.ca > >-- >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] Undefined variable: PHP_SELF
How about this: - Vic -Original Message- From: Manuel Ochoa [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 7:20 PM To: PHP General Subject: [PHP] Undefined variable: PHP_SELF I keep getting "Undefined variable: PHP_SELF" when using the following: Global variables are off... What am I doing wrong? __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable: PHP_SELF
Try $_SERVER['PHP_SELF'] instead of $PHP_SELF At 04:19 PM 8/15/2002 -0700, you wrote: >I keep getting "Undefined variable: PHP_SELF" when using the following: > > > >Global variables are off... What am I doing wrong? Jadiel Flores - http://www.abargon.com [EMAIL PROTECTED] (52-55) 52-29-80-34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Undefined variable: PHP_SELF
> I keep getting "Undefined variable: PHP_SELF" when using the > following: > > > > Global variables are off... What am I doing wrong? In current versions of PHP, $PHP_SELF is available if globals are on. You'll need $_SERVER['PHP_SELF'] instead if you're keeping globals off. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined variable: PHP_SELF
I keep getting "Undefined variable: PHP_SELF" when using the following: Global variables are off... What am I doing wrong?
[PHP] undefined variable...working in PHP 4.1.2 not 4.2.1
Hey all, I am having a problem that maybe some of you have had as well. I am using a session and when I pass the session variable to the next page it comes back as undefined. Is there some new syntax in 4.2.1 that I am missing, I thought that I made all the necessary changes. Here is the entire script: http://localhost/denied.htm";); exit; } ?> [snip] HTML CODE [snip] [snip] MORE HTML CODE [snip] I am getting the error at the echo statement between the HTML code, saying that $user is undefined. The previous page does register user. I am running PHP 4.2.1-CGI, IIS 5, W2K SP2. -josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Tr: [PHP] New to PHP - Undefined variable: ??????
Some things to consider: a) please read my first post :) (re: isset/empty/error_reporting) b) $FILE != $File != $file (case sensitive) regards, Philip Olson On Thu, 2 May 2002, nico_free wrote: > > - Original Message - > From: nico_free <[EMAIL PROTECTED]> > To: TGL <[EMAIL PROTECTED]> > Sent: Wednesday, May 01, 2002 11:47 PM > Subject: Re: [PHP] New to PHP - Undefined variable: ?? > > > > Well, I think the first 2 lines of your script should be : > > > > echo "\$FILE : $FILE"; > > var_dump($FILE); > > > > So, when submitting with no file, you should see some clues > > > > As far as I remember, your first test should be : > > > > <--code--> > > if($File!="none") { > > print ("File name: $File_name\n"); > > ...etc > > <--/code--> > > > > @++++ > > > > - Original Message - > > From: TGL <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, April 30, 2002 10:44 PM > > Subject: [PHP] New to PHP - Undefined variable: ?? > > > > > > > I'm new to PHP and can't get through my first script. I want to create a > > > form that will allow the user to attach a file. I started with the file > > > upload part of the form thinking that it ould give me the most problem, > > and > > > it has. > > > > > > This is the error message that shows when I view the page in the > browser: > > > > > > Warning: Undefined variable: File in > > > D:\inetpub\thegospellady\www\kia\form.php on line 8 > > > here is the url to the form: http://www.thegospellady.com/kia/form.php > > > > > > Please help. > > > > > > > > /* This next conditional determines whether or not to handle the form, > > > depending upon whether or not $File exists. */ > > > if($File) { > > > print ("File name: $File_name\n"); > > > print ("File size: $File_size\n"); > > > if(copy($File, "/users/$File_name")) { > > >print ("Your file was successfully uploaded!\n"); > > > } else { > > >print ("Your file could not be copied.\n"); > > > } > > > unlink($File); > > > } > > > > > > print ("Upload a file to the server:\n"); > > > print (" > > ENCTYPE=\"multipart/form-data\">\n"); > > > print ("File \n"); > > > print (" VALUE=\"Submit!\">\n"); > > > ?> > > > > > > > > > > > > -- > > > 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
Tr: [PHP] New to PHP - Undefined variable: ??????
- Original Message - From: nico_free <[EMAIL PROTECTED]> To: TGL <[EMAIL PROTECTED]> Sent: Wednesday, May 01, 2002 11:47 PM Subject: Re: [PHP] New to PHP - Undefined variable: ?? > Well, I think the first 2 lines of your script should be : > > echo "\$FILE : $FILE"; > var_dump($FILE); > > So, when submitting with no file, you should see some clues > > As far as I remember, your first test should be : > > <--code--> > if($File!="none") { > print ("File name: $File_name\n"); > ...etc > <--/code--> > > @ > > - Original Message - > From: TGL <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, April 30, 2002 10:44 PM > Subject: [PHP] New to PHP - Undefined variable: ?? > > > > I'm new to PHP and can't get through my first script. I want to create a > > form that will allow the user to attach a file. I started with the file > > upload part of the form thinking that it ould give me the most problem, > and > > it has. > > > > This is the error message that shows when I view the page in the browser: > > > > Warning: Undefined variable: File in > > D:\inetpub\thegospellady\www\kia\form.php on line 8 > > here is the url to the form: http://www.thegospellady.com/kia/form.php > > > > Please help. > > > > > /* This next conditional determines whether or not to handle the form, > > depending upon whether or not $File exists. */ > > if($File) { > > print ("File name: $File_name\n"); > > print ("File size: $File_size\n"); > > if(copy($File, "/users/$File_name")) { > >print ("Your file was successfully uploaded!\n"); > > } else { > >print ("Your file could not be copied.\n"); > > } > > unlink($File); > > } > > > > print ("Upload a file to the server:\n"); > > print (" > ENCTYPE=\"multipart/form-data\">\n"); > > print ("File \n"); > > print ("\n"); > > ?> > > > > > > > > -- > > 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] New to PHP - Undefined variable: ??????
Undefined variables errors are errors of level E_NOTICE. Instead of if ($File) use if (isset($File)) or similiar (such as empty()). Depending on your mission. A similiar example: if (empty($form_submitted)) { include 'form.html'; } else { include 'process_form.php'; } It's worth mentioning that one can control error levels both at runtime (error_reporting()) as well as in php.ini (.htaccess, etc). Regards, Philip Olson On Tue, 30 Apr 2002, TGL wrote: > I'm new to PHP and can't get through my first script. I want to create a > form that will allow the user to attach a file. I started with the file > upload part of the form thinking that it ould give me the most problem, and > it has. > > This is the error message that shows when I view the page in the browser: > > Warning: Undefined variable: File in > D:\inetpub\thegospellady\www\kia\form.php on line 8 > here is the url to the form: http://www.thegospellady.com/kia/form.php > > Please help. > > /* This next conditional determines whether or not to handle the form, > depending upon whether or not $File exists. */ > if($File) { > print ("File name: $File_name\n"); > print ("File size: $File_size\n"); > if(copy($File, "/users/$File_name")) { >print ("Your file was successfully uploaded!\n"); > } else { >print ("Your file could not be copied.\n"); > } > unlink($File); > } > > print ("Upload a file to the server:\n"); > print (" ENCTYPE=\"multipart/form-data\">\n"); > print ("File \n"); > print ("\n"); > ?> > > > > -- > 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] New to PHP - Undefined variable: ??????
I'm new to PHP and can't get through my first script. I want to create a form that will allow the user to attach a file. I started with the file upload part of the form thinking that it ould give me the most problem, and it has. This is the error message that shows when I view the page in the browser: Warning: Undefined variable: File in D:\inetpub\thegospellady\www\kia\form.php on line 8 here is the url to the form: http://www.thegospellady.com/kia/form.php Please help. \n"); print ("File size: $File_size\n"); if(copy($File, "/users/$File_name")) { print ("Your file was successfully uploaded!\n"); } else { print ("Your file could not be copied.\n"); } unlink($File); } print ("Upload a file to the server:\n"); print ("\n"); print ("File \n"); print ("\n"); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined variable when using if ($var) {}
Good day. What is this message that you get, that you don't want? A cursory glance of the code reveals two "else" statements attached to the same "if" statement. You should address that. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Martha S [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] undefined variable when using if ($var) {} I'm rather new to PHP, so this should be fairly easy to answer. I checked the manual and FAQ already. I'm using the following code, and I get the following message if $id has nothing in the var (i have it set to a default of type int, not null in mysql). Is there a way around this or something I'm missing? Thanks :) -- code--- if ($id) { $result = mysql_query("SELECT * FROM entries WHERE id=$id",$db); $myrow = mysql_fetch_array($result); printf("\n"); printf("%s", $myrow["title"]); printf("%s | ", $myrow["id"]); printf("%s", $myrow["posted"]); printf("%s\n", $myrow["post"]); printf("\n"); printf("all"); } else { do { printf("%s %s\n", $myrow["id"], $PHP_SELF, $myrow["id"], $myrow["title"], $myrow["post"]); } while ($myrow = mysql_fetch_array($result)); } else { // no records to display echo "Sorry, no records were found!"; } -- 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] undefined variable when using if ($var) {}
I'm rather new to PHP, so this should be fairly easy to answer. I checked the manual and FAQ already. I'm using the following code, and I get the following message if $id has nothing in the var (i have it set to a default of type int, not null in mysql). Is there a way around this or something I'm missing? Thanks :) -- code--- if ($id) { $result = mysql_query("SELECT * FROM entries WHERE id=$id",$db); $myrow = mysql_fetch_array($result); printf("\n"); printf("%s", $myrow["title"]); printf("%s | ", $myrow["id"]); printf("%s", $myrow["posted"]); printf("%s\n", $myrow["post"]); printf("\n"); printf("all"); } else { do { printf("%s %s\n", $myrow["id"], $PHP_SELF, $myrow["id"], $myrow["title"], $myrow["post"]); } while ($myrow = mysql_fetch_array($result)); } else { // no records to display echo "Sorry, no records were found!"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE ?)
I have error's enabled in php.ini. I keep getting Undefined variable when I run a script that contains IF or ELSE IF's. Is this normal because the variable hasn't been set at the beginning of the script ? Thank You <><><><><><><><><><><><><><><><> Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com <><><><><><><><><><><><><><><><> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined variable
This should work ... if ( IsSet($id) ) { . sql statement }else{ . } - Original Message - From: "Tshering Norbu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 19, 2001 12:22 PM Subject: [PHP] Undefined variable > Dear list, > > I test the following script on local web server and it runs fine. But when > I upload the script to the real web server I get the following > error/message, but the script works fine. Do you know why? > > Here is the error/message I get: > > Undefined variable : id in test.php on line 6 > > > And here is the script file (test.php): > > > > $db = mysql_connect("localhost", "root", "root"); > mysql_select_db("penpal",$db); > if ($id) > > $result = mysql_query("select * from penpal where id = $id",$db); > $myrow = mysql_fetch_array($result); > printf("ID: %s\n", $myrow["id"]); > printf("Name: %s\n", $myrow["name"]); > printf("Age/Sex/Location: %s\n", $myrow["asl"]); > printf("Description: %s\n", $myrow["description"]); > printf("Email: %s\n", $myrow["email"]); > } else { > $result = mysql_query("select * from penpal order by id desc", $db); > if ($myrow = mysql_fetch_array($result)) { > do { >printf("%s %s\n", $PHP_SELF, $myrow["id"], > $myrow["name"], $myrow["asl"]); > } while ($myrow = mysql_fetch_array($result)); > } else { > echo "Sorry, no records"; >} > } > ?> > > > > > > The id field in my table has the attribute: id tinyint (4) > > Thanks in advance > NOBBY > > > -- > 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] Undefined variable
it's a warning, not an error... you should check if it is set before you use it : If(IsSet($id)) { Do something... } Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Tshering Norbu [mailto:[EMAIL PROTECTED]] Sent: Friday, October 19, 2001 11:23 AM To: [EMAIL PROTECTED] Subject: [PHP] Undefined variable Dear list, I test the following script on local web server and it runs fine. But when I upload the script to the real web server I get the following error/message, but the script works fine. Do you know why? Here is the error/message I get: Undefined variable : id in test.php on line 6 And here is the script file (test.php): ID: %s\n", $myrow["id"]); printf("Name: %s\n", $myrow["name"]); printf("Age/Sex/Location: %s\n", $myrow["asl"]); printf("Description: %s\n", $myrow["description"]); printf("Email: %s\n", $myrow["email"]); } else { $result = mysql_query("select * from penpal order by id desc", $db); if ($myrow = mysql_fetch_array($result)) { do { printf("%s %s\n", $PHP_SELF, $myrow["id"], $myrow["name"], $myrow["asl"]); } while ($myrow = mysql_fetch_array($result)); } else { echo "Sorry, no records"; } } ?> The id field in my table has the attribute: id tinyint (4) Thanks in advance NOBBY -- 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] Undefined variable
Dear list, I test the following script on local web server and it runs fine. But when I upload the script to the real web server I get the following error/message, but the script works fine. Do you know why? Here is the error/message I get: Undefined variable : id in test.php on line 6 And here is the script file (test.php): ID: %s\n", $myrow["id"]); printf("Name: %s\n", $myrow["name"]); printf("Age/Sex/Location: %s\n", $myrow["asl"]); printf("Description: %s\n", $myrow["description"]); printf("Email: %s\n", $myrow["email"]); } else { $result = mysql_query("select * from penpal order by id desc", $db); if ($myrow = mysql_fetch_array($result)) { do { printf("%s %s\n", $PHP_SELF, $myrow["id"], $myrow["name"], $myrow["asl"]); } while ($myrow = mysql_fetch_array($result)); } else { echo "Sorry, no records"; } } ?> The id field in my table has the attribute: id tinyint (4) Thanks in advance NOBBY -- 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] Undefined Variable in formular... what happens???
Most likely it has to do with your error_reporting setting. See : http://uk.php.net/manual/en/phpdevel-errors.php#internal.e-notice http://uk.php.net/manual/en/features.error-handling.php Level E_NOTICE produces Warnings such as "Undefined Variable", so, doing the following : echo $iamnotset; Produces such a Error/Warning. Any "direct" use of $iamnotset will, which is why functions such as isset() and empty() exist : if (isset($var)) echo $var; I am guessing either you have : if ($submit) { // process form and no Warnings as $submit is set } else { // show form and WILL show the Warnings as $submit is not set } Consider : if (isset($submit)) { It's not uncommon to have E_NOTICE off but good little PHP developers develop with error_reporting turned up full blast, E_ALL in da house! Second, perhaps you expect register_globals to be on, see the following : http://uk.php.net/manual/en/configuration.php#ini.register-globals http://uk.php.net/manual/en/security.registerglobals.php If off, foo.php?fruit=apple will not create $fruit but rather, you'd go through a predefined variable like : $HTTP_GET_VARS['fruit']. http://uk.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Tue, 18 Sep 2001, Ingo wrote: > hello > i am using win2000 xitami, php and access. so my problem is that the script > couldn't find the variable.. . > so i cant save the user changed buttons and editfields... > > is that a known problem with xitami and php? when i try > to run the script on a real webserver with .php installed, it works fine. > > thanx ingo > > > > -- > 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] Undefined Variable in formular... what happens???
hello i am using win2000 xitami, php and access. so my problem is that the script couldn't find the variable.. . so i cant save the user changed buttons and editfields... is that a known problem with xitami and php? when i try to run the script on a real webserver with .php installed, it works fine. thanx ingo -- 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] 'Undefined Variable' help...
Hi Uchendu! Yes, this is very possible! Here are a few things that come to mind. There are of course many ways to do this : To check the existance of a variable, consider isset() as it checks for the existance of a variable : if (isset($HTTP_GET_VARS['images'])) Maybe set some default values for unset variables : if (!isset($width)) $width = 300; if (!isset($breads)) { $breads = array('rye','wheat','raison'); } A little debugging : A "Undefined Variable" Error is level E_NOTICE. More error handling information can be found here : http://www.php.net/manual/en/features.error-handling.php Doing the following will create a "Undefined Variable" Warning such as : if ($submit) // if (isset($submit)) echo $iamnotset; // if (isset($iamnotset)) echo $iamnotset; Warning: Undefined variable: submit in /home/http/file.php on line 24 Warning: Undefined variable: iamnotset in /home/http/file.php on line 25 Related places : Using Register Globals : http://www.php.net/manual/en/security.registerglobals.php Variables from outside PHP : http://www.php.net/manual/en/language.variables.external.php Configuration : error_reporting : http://www.php.net/manual/en/configuration.php#ini.error-reporting Hope that helps, good luck :) Regards, Philip Olson On Tue, 4 Sep 2001, Uchendu Nwachukwu wrote: > OK, I have a problem calling a function using default variables. > > In 'gallery.inc': > - > function gallery ($filename, $first = 1, $tablewidth = 4, $total = 20) { > echo "Filename: $filename, First image: $first, Table Width: > $tablewidth, Total: $total"; > } > - > > In 'gallery.php': > - > include('/path/to/gallery.inc'); > ... > gallery('test.txt',$first,$width,$images); > - > > $first, $width and $images are variables that are defined by the URL, as if > they were submitted through a form using HTTP GET, and they are designed to > be used like that. > > My problem is, if I don't define those variables in the URL when I run > gallery.php, PHP will come back with 'Undefined Variable' errors. Is there > any way I can prevent that from happening? > > TIA! > > -- > Uchendu Nwachukwu > unndunn AT yahoo DOT com - www.unndunn.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] 'Undefined Variable' help...
OK, I have a problem calling a function using default variables. In 'gallery.inc': - function gallery ($filename, $first = 1, $tablewidth = 4, $total = 20) { echo "Filename: $filename, First image: $first, Table Width: $tablewidth, Total: $total"; } - In 'gallery.php': - include('/path/to/gallery.inc'); ... gallery('test.txt',$first,$width,$images); - $first, $width and $images are variables that are defined by the URL, as if they were submitted through a form using HTTP GET, and they are designed to be used like that. My problem is, if I don't define those variables in the URL when I run gallery.php, PHP will come back with 'Undefined Variable' errors. Is there any way I can prevent that from happening? TIA! -- Uchendu Nwachukwu unndunn AT yahoo DOT com - www.unndunn.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] "undefined variable view ..."
On Mon, 27 Aug 2001 02:59, Wolfgang Schneider wrote: > Hi everybody, > can someone have a look at this bit of code please and help me out? > I am getting an error message when calling a php page containing the > code below, and the message reads: > > "Warning: Undefined index: view in > c:/bibelcenter.de/www/links/links.php3 on line 76" > > Now the line 76 in question is the last one of the code section below > ... can someone tell me what's missing there? how could this "index > view" be defined? > > > # Get the content before showing the webpage > if ($HTTP_GET_VARS['category'] == 'top_links') >{ > $your_current_location = "Most Popular Links"; > $category_links=Top_Hits($sp_max_top_links); > } > else if ($HTTP_GET_VARS['category'] == 'new_links') > { > $your_current_location = "Newly Added Links"; > $category_links=Newly_Added($sp_max_new_links); > } > else > { > $categories = viewPage($HTTP_GET_VARS['category']); > $your_current_location = > display_category($HTTP_GET_VARS['category']); > $category_links = > display_category_links($HTTP_GET_VARS['category'], > $HTTP_GET_VARS['view']); > } > _ > > Any helpful ideas? I only get this warning message in my Win2k > machine which I have set up for testing webpages purposes, it does > not show up on my ISP's server ... so I suspect that somehow the > server's php tolerates something in the code which my php version > here somehow puts up the warning ... > Any helpful hints and ideas are much appreciated. Thank you! There will probably be different levels of error reporting in the two php.ini files. view is an index of the array $HTTP_GET_VARS, and is apparently not defined at that part of the script. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA A cat sleeps fat, yet walks thin. -- 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] "undefined variable view ..."
Hi everybody, can someone have a look at this bit of code please and help me out? I am getting an error message when calling a php page containing the code below, and the message reads: "Warning: Undefined index: view in c:/bibelcenter.de/www/links/links.php3 on line 76" Now the line 76 in question is the last one of the code section below ... can someone tell me what's missing there? how could this "index view" be defined? # Get the content before showing the webpage if ($HTTP_GET_VARS['category'] == 'top_links') { $your_current_location = "Most Popular Links"; $category_links=Top_Hits($sp_max_top_links); } else if ($HTTP_GET_VARS['category'] == 'new_links') { $your_current_location = "Newly Added Links"; $category_links=Newly_Added($sp_max_new_links); } else { $categories = viewPage($HTTP_GET_VARS['category']); $your_current_location = display_category($HTTP_GET_VARS['category']); $category_links = display_category_links($HTTP_GET_VARS['category'], $HTTP_GET_VARS['view']); } _ Any helpful ideas? I only get this warning message in my Win2k machine which I have set up for testing webpages purposes, it does not show up on my ISP's server ... so I suspect that somehow the server's php tolerates something in the code which my php version here somehow puts up the warning ... Any helpful hints and ideas are much appreciated. Thank you! God bless you with His grace and peace Wolfgang Looking for Biblical information? COME AND SEE! -- ONLINE Courses: http://classes.bibelcenter.de ... NEW! -- BibelCenter: http://www.bibelcenter.de -- Bookstore: http://www.worthy.net/BibelCenter/ -- 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] Undefined Variable
On Sun, 18 Mar 2001 00:13, Jorge Alvarez wrote: > Hi there, > > I get this error every time I try to use a variable that has not been > declared. Is this new to PHP4? I do not recall this error in the past, > echo $MYVAR echoed nothing if $MYVAR was not set but no error was > raised. > > How can I revert PHP behavior to 'no-error' with undeclared variables? > > Many thanks in advance, > > Jorge Alvarez > PHP4 new user You may need to play around with the value of error_reporting in your php.ini file. -- David Robley| WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- 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] Undefined Variable
Hi there, I get this error every time I try to use a variable that has not been declared. Is this new to PHP4? I do not recall this error in the past, echo $MYVAR echoed nothing if $MYVAR was not set but no error was raised. How can I revert PHP behavior to 'no-error' with undeclared variables? Many thanks in advance, Jorge Alvarez PHP4 new user -- 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] Undefined variable
try setting error_reporting(0) in PHP.ini Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Dundee (Roland) [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 04, 2001 5:35 AM To: Php_List Subject: [PHP] Undefined variable Hello When creating a page(php) on Win2000 I get alot of 'Undefined variable' error messages, but there are no errors at all running the same page on a apache server. How come? Thanks for some hints. Roland -- 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] Undefined variable
"Dundee (Roland)" <[EMAIL PROTECTED]> wrote: > When creating a page(php) on Win2000 I get alot of 'Undefined variable' > error messages, but there are no errors at all running the same page on a > apache server. Is the variable a user defined variable? If so, my guess is the error reporting level for the two servers is different. See the error handling section of php.ini and see if the default settings differ b/w the two servers. Also see error_reporting() if you're explicitly using that function. If the variable is a PHP or environment variable perhaps the variable is available on Apache, but not on Win2k. I have very little experience with PHP on Windows so it could be something else, but that's where I'd start. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.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] Undefined variable
Hello When creating a page(php) on Win2000 I get alot of 'Undefined variable' error messages, but there are no errors at all running the same page on a apache server. How come? Thanks for some hints. Roland -- 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]