Jump to content

[SOLVED] Sending data ( by not using forum or get )


Rommeo

Recommended Posts

Hi

 

i m trying to write a program about simple membership system and i wanna send the data to "addmember.php ". But i cant send the data by address ..

Let me explain ;

here is what i wanna do :

<?php
// $i is the data taken from DB = membership status 
$i = $i + 5;
?>
<----html starts here ----->
<form method="post" action="addmember.php">
<input name="name" type="text" id="name">
<input name="surname" type="text" id="surname"> 
.      <---------possible to send $i here ? ------>
.
</form>

i cant send $i value by address(GET), cant send it by POST cause user does not enter anything.( as i know, i m a newbie btw ). So what else i can do to send it to addmember.php ? i ll be glad if you can help.

 

Thanx in advance.

I don't understand your problem. I suppose that you want to do this:

 

<?php
// $i is the data taken from DB = membership status 
$i = $i + 5;
?>
<----html starts here ----->
<form method="post" action="addmember.php">
<input name="name" type="text" id="name">
<input name="surname" type="text" id="surname"> 
<---------------------------- $i variable ----------------------------->
<?=$i?>
.
</form>

you diffently want to use the hidden type in the form, it would be the eaisest way. You could also use sessions.

 

$_SESSION['i'] = $i;

 

And then get it on the ohter page.

 

$i = $_SESSION['$i'];

 

but this requeries that you start your session in the top of the script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.