Jump to content

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


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.

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.