p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > Pro PHP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 30th, 2008, 12:44 AM
Registered User
Points: 16, Level: 1
Points: 16, Level: 1 Points: 16, Level: 1 Points: 16, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question PHP5 is not passing form values from input variables

Hi,

I am working with PHP5 and I am not able to even pass values from an HTML form to a php script. The crazy part about this condition is the other day it was working fine. I have apache 2.2, and php5 installed on my notebook and also I have turned on the register_globals to equal on in the php.ini file.

Also, I am doing this with an HTML page using a form input variable that gets a php script and the php script should be able to read the variable that I create in the HTML page.


It is a very simple HTML form and php script:

<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=POST ACTION="checkbox.php">
Have you eaten shrimp before?
<INPUT NAME="Choice" TYPE="Checkbox">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
------------------------------------------------------------------
(PHP SCRIPT)

<HTML>
<HEAD></HEAD>
<BODY>
<?php
echo $Choice;
?>
</BODY>
</HTML>

I do not know if this is php or windows causing this problem.

I just need to get this to work on my notebook so I can write some php scripts and test the scripts locally on the notebook.

Any help is appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old December 30th, 2008, 03:35 AM
Authorized User
Points: 175, Level: 3
Points: 175, Level: 3 Points: 175, Level: 3 Points: 175, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Location: London
Posts: 37
Thanks: 1
Thanked 5 Times in 5 Posts
Default

try the following code plz.

Code:
<html>
    <head>HTML Page</head>
    <body>
        <form method="post" action="checkbox.php">
            have you eaten shrimp before?
            <input type="checkbox" name="choice"  />
            <br>
            <br>
            <input type="submit" name="action" value="Submit">
        </form>
    </body>
</html>
Code:
<html>
    <head>PHP File(checkbox.php)</head>
    <body>
        <pre>
        <?php
            echo $_POST['choice'];
            echo "\n";
            print_r($_POST);
            echo "\n";
            print_r($_GET);
        ?>
        </pre>
    </body>
</html>
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old December 30th, 2008, 02:30 PM
Registered User
Points: 16, Level: 1
Points: 16, Level: 1 Points: 16, Level: 1 Points: 16, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Upgraded PHP

I appreciate the script and thank you very much.

I also went ahead and upgraded the php and got it working on the old code as well now.

Thank You...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP5 is not passing form values from input variables sjfoglia Beginning PHP 1 December 30th, 2008 02:24 PM
Passing Input Date Parameter values preethig Crystal Reports 0 February 28th, 2008 08:39 AM
Passing variables from 1 form to another. jainin_shah9 C# 10 February 18th, 2008 07:59 PM
passing values and variables anshul Javascript How-To 3 July 26th, 2004 03:30 PM
Clearing values from form and ASP variables sniffer Classic ASP Basics 1 September 24th, 2003 03:40 AM



All times are GMT -4. The time now is 11:11 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc