Jump to content

Recommended Posts

Hi there

I am a total newbie at PHP after being an ASP, ASP.net developer for the last ten years i decided yesterday that i would attempt to move over to PHP.

My first project was to pass two variables from a simple form to another page and write them out.  Easy and yes it worked on my local machine, well when i say worked i could only get it to work via the GET method rather than the POST.  why i dont know!!

Anyway when i uploaded it to my server it doesnt work!  The variables seem to be in the URL and there are no errors in my PHP File when it writes out the HTML.  Its just that the spaces where i have <?php echo ($_GET["Course"]); ?> there is no text.  If that makes sense.  It works perfectly well on my local machine.  Is PHP enabled on my server!!  It is a corporate server if that makes any difference.

Heres the code anyway:

Form:
<form name="book" method="get" action="test.php">
<input name="course" type="hidden" value="Foundation Food Hygiene Certificate" />
<input name="cost" type="hidden" value="45.00" />
      <input type="submit" name="Submit" value="Book Now" class="SubmitButton"  />
    </form>

Test.php:

<P>Thank you for your intrest in our <b><?php echo ($_GET["Course"]); ?>!</b>

any ideas would great!!!!
Link to comment
https://forums.phpfreaks.com/topic/33766-strange-server-behavouir/
Share on other sites

PHP is case sensitive...

Change this [code=php:0]<?php echo ($_GET["Course"]); ?>[/code]
to this [code=php:0]<?php echo ($_GET['course']); ?>[/code]
I've replaced the double quotes with single quotes too, but that's just my preference.

Regards
Huggie
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.