[PHP] PHP URL query
Hi all, I'm somewhat new to php, though I have played a bit with the language. I'm currently learning the language, and I'm having a problem passing variables through "URL query". Here is what I have: A simple HTML file that contains: Hi, this is a test! and a php file that contains: However, when I click on the link on the HTML file, I dont get the value of $var passed to the php script. I have also tried passing multiple variables separated by &, and none of those gets passed to the php script. The files are hosted on a local Debian etch server running apache 2.0.54 and php 4.3.10. Is there something I need to check/change in the config files of apache or php? Regards, IraqiGeek www.iraqigeek.com Boat: A hole in the water surrounded by wood into which one pours money. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP URL query
On Wednesday, May 10, 2006 6:08 PM GMT, Jason Gerfen <[EMAIL PROTECTED]> wrote: IraqiGeek wrote: Hi all, I'm somewhat new to php, though I have played a bit with the language. I'm currently learning the language, and I'm having a problem passing variables through "URL query". Here is what I have: A simple HTML file that contains: Hi, this is a test! and a php file that contains: try echo "Welcome to our website, $_GET['var']"; Jason, brad, Eric, Dave, and John, Thank you all for pointing $_GET and register_globals. The tutorial I'm reading is from 2000 and references PHP 4.1. However, when I click on the link on the HTML file, I dont get the value of $var passed to the php script. I have also tried passing multiple variables separated by &, and none of those gets passed to the php script. The files are hosted on a local Debian etch server running apache 2.0.54 and php 4.3.10. Is there something I need to check/change in the config files of apache or php? Regards, IraqiGeek www.iraqigeek.com Boat: A hole in the water surrounded by wood into which one pours money. Regards, IraqiGeek www.iraqigeek.com The trouble with doing something right the first time is that nobody appreciates how difficult it was. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] METHOD=POST not worikng
Hi all, I'm learning PHP on a Debian Etch with Apache 2.0.54 and PHP 4.3.10, and using Firefox 1.5.3 on a Windows XP box to browse the sample site. I wrote a small form to get user input. If I use METHOD=GET, then the form works fine, without any glitches. However, if I use METHOD=POST in the form, I don't get the data back to the script. Googling around, I found a reference to mod_bandwidth, but AFAIK, this module is used to regulate/limit user traffic. Are there any modules missing that prvent METHOD=POST from working properly? any config files that need to be edited? Thanks. Regards, IraqiGeek www.iraqigeek.com The average woman would rather have beauty than brains, because the average man can see better than he can think. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] METHOD=POST not worikng
On Saturday, May 13, 2006 4:59 PM GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: AFAIK it should be working just fine. I'm not aware of POST not working in any circumstance other than PHP not working at all. Can you post your test script? We could better judge what's happening based off that. Just make sure you're referencing the variables with $_POST or $_REQUEST, not $_GET. Slightly off topic. If you're not already, always make sure to verify/escape your input from POST/GET/RSS/etc. That will help make your pages more secure. It might seem like you don't need to do it right now at the beginning, but it's a good habit to get into... One that I need to follow better (especially when I have a really short deadline). Ray PHP is indeed working. If I use METHOD=GET instead of POST, the script works without any issues. Here is the test script I'm using: test script //If I use METHOD=GET here, the script works flawlessly Type your text here: Unable to connect to the database server at this time."); exit(); } //select test database if([EMAIL PROTECTED]("test")){ echo("Unable to locate test database at this time."); exit(); } //if a sample text has been submitted, add it to the database. if("SUBMIT"==$_REQUEST['submit']){ //I have tried _GET, _POST, and _REQUEST $text=$_REQUEST['text']; //Same thing here, _GET, _POST, and _REQUEST $sql="insert into test_table set ". "Text='$text', ". "Date=CURDATE();"; if(mysql_query($sql)){ echo("Your text has been added."); } else { echo("Error Adding submitted text: ". mysql_error().""); } } echo("Here are all the texts in our database: "); //Request the text of all the texts $result=mysql_query("select Text from test_table"); if(!$result){ echo("Error performing query: ".mysql_error().""); exit(); } //display the texts in a paragraph while($row=mysql_fetch_array($result)){ echo("".$row["Text"].""); } //when clicked, this link will load this page with the text //submission form displayed. $self=$_SERVER['PHP_SELF']; echo("". "Add a text"); endif; ?> Thanks. Regards, IraqiGeek www.iraqigeek.com My computer isn't that nervous... it's just a bit ANSI. Original Message Subject: [PHP] METHOD=POST not worikng From: "IraqiGeek" <[EMAIL PROTECTED]> Date: Sat, May 13, 2006 7:16 am To: "PHP-General" Hi all, I'm learning PHP on a Debian Etch with Apache 2.0.54 and PHP 4.3.10, and using Firefox 1.5.3 on a Windows XP box to browse the sample site. I wrote a small form to get user input. If I use METHOD=GET, then the form works fine, without any glitches. However, if I use METHOD=POST in the form, I don't get the data back to the script. Googling around, I found a reference to mod_bandwidth, but AFAIK, this module is used to regulate/limit user traffic. Are there any modules missing that prvent METHOD=POST from working properly? any config files that need to be edited? Thanks. Regards, IraqiGeek www.iraqigeek.com The average woman would rather have beauty than brains, because the average man can see better than he can think. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] METHOD=POST not worikng
On Sunday, May 14, 2006 2:01 AM GMT, chris smith <[EMAIL PROTECTED]> wrote: On 5/14/06, IraqiGeek <[EMAIL PROTECTED]> wrote: On Saturday, May 13, 2006 4:59 PM GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: AFAIK it should be working just fine. I'm not aware of POST not working in any circumstance other than PHP not working at all. Can you post your test script? We could better judge what's happening based off that. Just make sure you're referencing the variables with $_POST or $_REQUEST, not $_GET. Slightly off topic. If you're not already, always make sure to verify/escape your input from POST/GET/RSS/etc. That will help make your pages more secure. It might seem like you don't need to do it right now at the beginning, but it's a good habit to get into... One that I need to follow better (especially when I have a really short deadline). Ray PHP is indeed working. If I use METHOD=GET instead of POST, the script works without any issues. Here is the test script I'm using: test script You're checking for a get string here, not a post string. So it will never get into this part of the code. I have tried _POST here, and when its then that I won't be able to get into the part of the code that I want to get into. $addtext is passed through an HREF tag, not through the form. I think I have reached the limit where I need to use a debugger to get any further. I just installed Gubed, and currently reading the documentation. Once I can start debugging the script, I will be able to know what and where exactly are things going wrong. Regards, IraqiGeek www.iraqigeek.com I am at two with nature. Woody Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] METHOD=POST not worikng
On Tuesday, May 16, 2006 1:20 AM GMT, Richard Lynch <[EMAIL PROTECTED]> wrote: On Sat, May 13, 2006 9:16 am, IraqiGeek wrote: I'm learning PHP on a Debian Etch with Apache 2.0.54 and PHP 4.3.10, and using Firefox 1.5.3 on a Windows XP box to browse the sample site. I wrote a small form to get user input. If I use METHOD=GET, then the form works fine, without any glitches. However, if I use METHOD=POST in the form, I don't get the data back to the script. Googling around, I found a reference to mod_bandwidth, but AFAIK, this module is used to regulate/limit user traffic. Are there any modules missing that prvent METHOD=POST from working properly? any config files that need to be edited? httpd.conf for Apache can be configured to not accept POST data. I believe some default httpd.conf settings did just that, in olden days... You'd be getting an error message from the server if that was the case, though. What are you using to try to SEE the data? It's also possible that php.ini settings for EGCPS order preference (whose name is escaping me) might be badly-configured enough to cause this... Richard, Thanks for the replies. I have already fixed this problem thanks to the help from the list members. Rabin has noted to me that php_self, as a string is case sensative. I corrected the call to be $_SERVER['PHP_SELF'], and everything was fine. Regards, IraqiGeek www.iraqigeek.com "Bollo^G^G^Gther", said Pooh, on his VT220 emulator. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php transparent proxy
Hi all, Is anyone aware of a php script that runs as a proxy (not a web proxy)? I have a hosting account with a dedicated IP, and I'm wondering if I can use this account to run a proxy where I enter my account's dedicated IP in the browser as a proxy, and use that to surf the net. I am already running a web proxy, but want to expand to be able to use the proxy with other applications. Regards, IraqiGeek www.iraqigeek.com Whoever undertakes to set himself up as judge in the field of truth and knowledge is shipwrecked by the laughter of the Gods. Albert Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php