Re: [PHP] PHP variable values
On Feb 10, 2008 6:30 PM, Ron Piggott [EMAIL PROTECTED] wrote: What is the command which shows the value of all the variables in memory? Ron get_defined_vars() -nathan
[PHP] PHP variable values
What is the command which shows the value of all the variables in memory? Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php variable
Hello, If i set a variabele in lets say 'script one'. When i jump into 'script two', is there a way (without cookies) to read the variable set in 'script one' Like: SCRIPTONE.PHP: html body ?php $var=¨How are you¨; ? form method=post action=scripttwo.php table tr td style=vertical-align: top;name:/td td style=vertical-align: top; input type=text name=name/td /tr /table input type=submit name=submit value=OK /form /body /html SCRIPTTWO.PHP: html body ?php $naam=$_POST['naam']; print ¨Hello $naam¨; print ¨$var¨; ? /body /html THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php variable
[snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php variable
Read about sessions in the manual. Onno Kuipers wrote: Hello, If i set a variabele in lets say 'script one'. When i jump into 'script two', is there a way (without cookies) to read the variable set in 'script one' Like: SCRIPTONE.PHP: html body ?php $var=¨How are you¨; ? form method=post action=scripttwo.php table tr td style=vertical-align: top;name:/td td style=vertical-align: top; input type=text name=name/td /tr /table input type=submit name=submit value=OK /form /body /html SCRIPTTWO.PHP: html body ?php $naam=$_POST['naam']; print ¨Hello $naam¨; print ¨$var¨; ? /body /html THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php variable
Jay Blanchard wrote: [snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. I tried... something like this input type=hidden name=var2 value=¨?php print $var2; ?¨ but it doesn't work. Maybe you mean something totaly different, can you show me what you mean. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php variable
[EMAIL PROTECTED] Onno Kuipers: Jay Blanchard wrote: [snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. I tried... something like this input type=hidden name=var2 value=¨?php print $var2; ?¨ but it doesn't work. Maybe you mean something totaly different, can you show me what you mean. Should work, if not use sessions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php variable
Should also work if you use the POST method... Comex [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] Onno Kuipers: Jay Blanchard wrote: [snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. I tried... something like this input type=hidden name=var2 value=¨?php print $var2; ?¨ but it doesn't work. Maybe you mean something totaly different, can you show me what you mean. Should work, if not use sessions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php variable
Page 1 input type=hidden name=var2 value=test Page 2 echo $_REQUEST['var2']; //or echo $_POST['var2']; //== //Sometime noticed some glitch with $_POST because sometime PHP think the data go to $_GET... //So, to prevent future headache, I use $_REQUEST['var2'] at all time... //== Scott Comex [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] Onno Kuipers: Jay Blanchard wrote: [snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. I tried... something like this input type=hidden name=var2 value=¨?php print $var2; ?¨ but it doesn't work. Maybe you mean something totaly different, can you show me what you mean. Should work, if not use sessions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] php variable
Hi, Tuesday, October 14, 2003, 12:42:18 AM, you wrote: OK Jay Blanchard wrote: [snip] $var=¨How are you¨; THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO. [/snip] Pleace $var in a hidden form element. OK I tried... something like this OK input type=hidden name=var2 OK value=¨?php print $var2; ?¨ OK but it doesn't work. Maybe you mean something totaly different, can you OK show me what you mean. Make sure you put the hidden part between form tags form action=?php echo $_SERVER['PHP_SELF']? method=post input type=hidden name=var2 value=?php echo $var2? input type=submit /form -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Variable Declare
Hey guys, Thanks in advance for your help. I'm working on emailing the contents of a form using php. It worked fine, until I turned global_variables off in an attempt to secure the form (I still have yet to write the data validation part). Anyway, I have an IF statement that fires depending on a hidden variable in the form. If the variable is empty, it loads the form. If the variable contains the hidden value I give it during form creation, then it emails the contents on the form and displays a thank you msg instead of displaying the form. The problem I have run into, involves the hidden value for the form. I didn't have to declare it before when I had global_variables turned on, but now I have to. I searched the manual and tried statements like global $variablename but the code wouldn't run properly. I've searched through the newsgroups as well, but I'm new to PHP so it was tough to figure out what to search for. I'm sure all I'm missing is one line of code. I included my code below. The problem exists in this line: if ($_POST['frmAction'] == formmail) which is before where the form is created so the $frmAction variable isn't declared yet. I'm getting a variable not declared error, which I know, but if I declare the variable earlier in the document, then it resets the value that I give it before I submit the form. How do I make this work? Thanks so very much!! Steve html head /head body **HTML stuff here** ?php // error handler function e($type, $msg, $file, $line) { $errorLog = error.log; **Error Handler code here** } error_reporting(E_ERROR | E_WARNING); set_error_handler(e); $TO = [EMAIL PROTECTED]; $MP = mail.mailserver.com; ? ?php if ($_POST['frmAction'] == formmail) { $fd = popen($MP,w); fputs($fd, To: $TO\n); fputs($fd, From: $_POST['name'] $_POST['email']\n); fputs($fd, Subject: $_POST['inforequest']\n); fputs($fd, X-Mailer: PHP3\n); fputs($fd, Name: $_POST['name']\n); fputs($fd, Business: $_POST['business']\n); fputs($fd, Phone: $_POST['phone']\n); fputs($fd, Email: $_POST['email']\n); fputs($fd, Details: $_POST['details']); pclose($fd); ? **HTML thank you msg here** ?php exit; } else { ? table form action=test.php method=POST select name=inforequest optionSelect Info Source/option option value=Option 1Option 1/option option value=Option 2Option 2/option option value=Option 3Option 3/option option value=Option 4Option 4/option /select /td /tr tr input type=text name=name /td /tr tr input type=text name=business /td /tr tr input type=text name=phone /td /tr tr input type=text name=email /td /tr tr textarea name=details wrap=PHYSICAL cols=35 rows=8/textarea /td /tr tr td input type=hidden name=frmAction value=formmail input type=submit name=Submit value=Submit input type=reset name=Reset value=Reset /td /tr /form /table ?php } ? **last bit of HTML here** /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php