Jump to content

code bug after upgrade from PHP 5.1 to 5.2


wipe

Recommended Posts

Hi guys,

 

a few days i upgrade php from 5.1 to 5.2.16

all seem fine and last 2 days i start to find some bugs.

I use this code to get url var and pass from a form:

                <?php
				  echo $_GET['id'];
?>            
                <input name="ids" type="hidden" id="ids" value="<?php $_GET['id'];?>" />

 

In the email i receive all data from the form, but not this that i get from the URL.

 

in code to send to email i just use:

$_POST[id] 

 

This work fine in 5.1 but not in this version.

 

anyone have an idea why?

 

Wipe

Link to comment
Share on other sites

Look to the HTML of the form. It should be:

<form action="" method="">

 

If 'method' is not defined, default it is set to 'get', and then you have to collect the variable with $_GET['id']. If the method is set to 'post', then you have to fetch the variable with *_POST['id']. You could also choose to fetch the variable with $_REQUEST['id'] - this predefined variable holds the content of $_POST, $_GET and $_COOKIE.

Link to comment
Share on other sites

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.