back button script in php

  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

does anyone know how to write a back button script in php rather than javascript. i have a form with some simple validation and i would rather use a php button rather than a browser button. plus the button must not eradicate what has been filled in previously. the button is for a form and if all the fields havent been filled in then this error message comes up with the php back button.

i dont like js because of its frailties.

cheers
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

You could use
PHP Code: [ Select ]
$_SERVER[HTTP_REFFERER]

but then if it was a form it would not save their information, and there is no real way other than javascript which is all browser based.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

what if you hqve javascript turned off then what?
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

Code: [ Select ]
history:back()
??!?!?!
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i know how to write a back button in javascript. what i am asking is if there is a way to do it in php. the stipulation is that the information must be preserved or not erased when the back button is pressed. just like when u use the browser back button
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

the javascript version should do just that.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i know that people can turn javascript off on their browsers. if i use javacript for the back button then it will not work. i would like to use a button on the site to navgate back to the previous page
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

javascript can be turned off?!?! oh man how? why?

THATS NEWS TO ME
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

PHP Code: [ Select ]
if($page != 1){
 
        $pageprev = $page--;
 
    echo("<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."</a>&nbsp;");  
  1. if($page != 1){
  2.  
  3.         $pageprev = $page--;
  4.  
  5.     echo("<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."</a>&nbsp;");  


is this the previous page code that i can use or is there some alterations to be made on this?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

That code looks like it was made for someones script specifically. But that would also erase the persons data that they had inputed. Only way that their information could be saved is through using javascript.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i might have to use javascript even tho i dont like it. but what i have managed to do is the php validation.

i suppose if people havent turned the javascript off then they will see the javascript back button. if they have then they will use the browser back button. i have left a error message telling them to go back to the form so they should know what to do by either button

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 160 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.