Closed Thread Icon

Topic awaiting preservation: can't get variables from one php page to go to other ? Pages that link to <a href="https://ozoneasylum.com/backlink?for=13109" title="Pages that link to Topic awaiting preservation: can&amp;#039;t get variables from one php page to go to other ?" rel="nofollow" >Topic awaiting preservation: can&#039;t get variables from one php page to go to other ?\

 
Author Thread
paritycheck
Bipolar (III) Inmate

From:
Insane since: Mar 2004

posted posted 03-25-2004 09:27

Hi guys I've got problems with PHP here. I'm playing out with tutorials and practicing. I seem to have run into some trouble that don't quite add up :S

I have a link on a page that sends variables to a page namely edit_db.php4. The problem is that the values never get there. I want that they be displayed in a makeeshift form on the other page but nope it doens't happen. Below is the url I type in:
http://localhost/phpsite/edit_db.php4?id=4&Name=Wally


And this is the code for my page edit_db.php


<?php

$id = $_REQUEST['id'];
$Name = $_REQUEST['Name'];
?>
<body>
<h1>Modify Here </h1>
<form name="form1" method="post" action="">
<table width="473" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="177">ID Number: </td>
<td width="296"><span class="style1"><?php echo $id; ?>&nbsp;</span></td>
</tr>
<tr>
<td>Name </td>
<td><input type="text" name="textfield" value = "<?php echo "$Name"; ?>"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><div align="right">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>

I'd really appreciate any help on this guys


Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-25-2004 10:57

well... it looks ok.
Try sticking 'error_reporting(E_ALL)' at the very top and see if it brings any error messages.

Rhino
Bipolar (III) Inmate

From: New Jersey, USA
Insane since: Jul 2003

posted posted 03-26-2004 15:14

since you are using the POST method...try getting the variables from the the POST

$id = $_POST["id"];
$name = $_POST["name"];

NOTE..you should also check to see if the variables are there first before trying to retrieve them to avoid any errors.

$id = 0;

if (isset($_POST["id"]))
$id = $_POST["id"];


Hope this helps!

« BackwardsOnwards »

Show Forum Drop Down Menu