Jump to content

Need some help with a form and a link


Fenhopi

Recommended Posts

Hi, I have a script that creates a frame. The script shows a page of my choosing.

However, somehow I need to transfer some values like username from one page, to the page that is opened in the frame.

To call the frame I use like this:

<a href="postback.php" id="start">TEST </a>

But the only way I know to  transfer values between pages is with forms and $_POST.

So I have this form:

       <form method="post" action="postback.php">
                <input type="hidden" name="postbackto" value="<? echo $friendshares['byuser']; ?>">
                <input type="hidden" name="postbackfrom" value="<? echo $friendshares['person']; ?>">
                <INPUT NAME="post" TYPE="submit" class="submit" id="start" value="That's nice"  ALT="like">
                </form>

So what I'm trying to do is that when I click the link, the form is submitted, the frame opens the postback.php and I can view the info from the form.

 

All help is appreciated!

             

Link to comment
Share on other sites

Thanks, man.

 

It did what I tried doing but it didn't work out.

Because the frame opens over the window I'm in, so what happens is that i click the link, it starts opening the frame, then I get redirected to postback, and I want to stay on the page I am and just retrieve it through the frame. Any idea how to do this?

Link to comment
Share on other sites

I like Solon's idea.  As an added option, might consider a div rather than a frame and sessions to pass the variables

 

Some psuedo code to ponder...

$_SESSION['byuser'] =$friendshares['byuser'];
$_SESSION['person'] = $friendshares['person'];
?>
<a href="postback.php">some text</a>
<?PHP
if(!isset($_SESSION['byuser']) OR !isset($_SESSION['person'])) {
echo an empty div
}else{
echo a div with the content you want
}

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.