Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

normal form button *submission* 1

Status
Not open for further replies.

unborn

Programmer
Joined
Jun 26, 2002
Messages
362
Location
US
ok i made a news script... now how do i get it do preview stuff... like well i have a few thing i want it to do.. like a few diff buttons.. and i have them layed out but how can i make it tellw hat was pushed and forward it to my script... is this somehtign i need to make a few form things for? or can i pull the info from one form to another? thanks

in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
You would have to name your form buttons and then check if that button was clicked with an isset.
In the form:
[tt]<input type=&quot;submit&quot; name=&quot;preview&quot; value=&quot;Preview&quot; />
<input type=&quot;submit&quot; name=&quot;post&quot; value=&quot;Post it&quot; />[/tt]
In the script:
[tt]if (isset($_<method>['preview']))
/* do stuff for preview */
elseif (isset($_<method>['post']))
/* do stuff for post */
else
/* something must have went wrong */[/tt]

//Daniel
 
danielhozac:
whats this:$_<method>['preview']?

Known is handfull, Unknown is worldfull
 
I suppose <method> is either POST or GET. Daniel is referring to the superglobal arrays.
 
[hammer]
yup i found that out too late (just after submitting my request)....

Known is handfull, Unknown is worldfull
 
thanks a million!

in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top