Jump to content

[SOLVED] onClick = "" href = ""


EagerWolf

Recommended Posts

JS is used, couse this is text link ...

 

I have 2 urls ...

 

NO.1: Back ... It should go a step backward ...

NO.2: Next ... It should go a step forrward ...

 

I don't understand, how can I call next or previous page...

 

<form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF']; ?>">
</form>
print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Back >>");
print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Next >>");

 

$var1 and $var2 tell where to go... $var1 is set before... $var2 depands on which is clicked ... Next or Back...

 

Can you give an example...

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191161
Share on other sites

If you are trying to move between browser history you can use js functions.

 

history.go(-1);
history.go(1);

 

otherwise use

<form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF']; ?>?$var1=$var2&$var3=$_SESSION[$var3]">
</form>
print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Next >>");

 

so you will have GET variables alonghwith the form post data.

Link to comment
https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191167
Share on other sites

<form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF'];?>
?$var1=$var2&$var3=$_SESSION[$var3]">
</form>
print ("<a onClick='javascript: submitform()'>Next >>");

 

So code should look like this?

 

Why is ?$var1=$var2&$var3=$_SESSION[$var3]"> ... It will be just printed the way it is ... It will be HTML code..

Link to comment
https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191176
Share on other sites

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.