Jump to content

Problem defining form action


monkeybidz

Recommended Posts

I tried setting the form action as:

 

<?=$postar;?>

<?=$postar?>

<? print $postar;?>

 

The form is to post to itself depending on the set mode. Here is the code.

<?
if($mode=="recall"){
$postar="sell.php?mode=recall";
}else{
$postar="sell.php";
}
?>
       <form action="<? echo $postar; ?>" method="post" name="zipcodestuff" target="_self" id="zipcodestuff">

 

I need it to post $postar in form action.

Link to comment
Share on other sites

That does the same thing I had, only problem I am having, is that the form is multipart and when the first part is submitted, it is to post to itself and keep other variable from the second form which are pre defined since this page is a page that is bieng edited by a user. When i submit the form, all other vars are lost.

Link to comment
Share on other sites

try this monkeybidz:

 

<?php
session_start();

if ($mode == "recall") {
$postar="". $_SERVER['PHP_SELF'] ."?mode=recall";
}
else {
$postar="". $_SERVER['PHP_SELF'] ."";
}

$_SESSION['mymode']="$postar";

?>
<html>
<head>
        
<title>Untitled</title>

</head>
<body>

<form name="zipcodestuff" action="<?php echo $_SESSION['mymode']; ?>" method="post">
<input type="submit">
</form>

</body>
</html>

 

I think this should do what you want it to do.

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.