Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Back button

  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Back button

    Hi, for my site i have made it so that after you have created an image you can click on the edit sig button to take you back to the page before where you can reposition the text etc.

    The back button code i used is

    Code:
      <input type=button value="Edit Signature"
    onCLick="history.back()">
    this works fine but when you go back the images checkbox is no longer checked. Its a real pain having to check it every time and most of the time people dont realise it needs to be done.

    Is there any way of making the page remember which box was checked and keeping it like that when the back button is pressed.

    Thanks a lot Digi.
    Visit Gamesigs.co.ukto create your own personalised signature using our generator,

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,858
    Thanks
    22
    Thanked 157 Times in 148 Posts
    Instead of relying on the brower's history, why don;t you just link to the previous page and repopulate the fields dynamically.

    For example, in a page called process_sig.php, you would save the values of your form (from create_sig.php) to a MySQL database, and then give the user the option to go back and edit their signature:

    Code:
    <input type="button" value="Edit Signature"
    onclick="window.location='create_sig.php'" />
    And in create_sig.php:

    PHP Code:
    <?

    $query 
    "SELECT * FROM user_table WHERE name='".$_SESSION['username']."'";
    $result mysql_query($query);

    while (@
    $row mysql_fetch_assoc($result))
    {

    ?><p>Create/Edit Signature Form</p>
    <form method="post" action="process_sig.php" name="form1">
    <input type="checkbox" name="checkbox" <?

    if ($row['checkbox'] == "checked")
        print 
    "checked='checked' ";

    ?>/>

    <textarea name="textarea" cols="20" rows="20"><?

    if (!empty($row['textarea']))
        print 
    $row['textarea'];

    ?></textarea>
    </form><?

    }

    ?>
    Last edited by chump2877; 02-03-2007 at 02:08 PM.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unfortunately i cannot do that because my host only gives me 1 database and i have already used it on the forum.

    p.s am i correct in thinking that this is a problem only asscoiated with internet explorer, i.e firefox and netscape remember it?
    Visit Gamesigs.co.ukto create your own personalised signature using our generator,

  • #4
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,858
    Thanks
    22
    Thanked 157 Times in 148 Posts
    Unfortunately i cannot do that because my host only gives me 1 database and i have already used it on the forum.
    What prohibits you from creating another table in your database?...your database is only limited by how much space you have used on the server...have you used up all of your allotted server space? If not, then you can create another table...

    p.s am i correct in thinking that this is a problem only asscoiated with internet explorer, i.e firefox and netscape remember it?
    I don;t know for sure, but just due to the fact that you have noticed a difference among browsers in how the javascript history object works, why would you bother with it? With PHP/MySQL, there are no browser issues to work around...
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks ill give it a go. I wasnt sure about the database thing cus im a bit of a noob in that area. Amyway thanks for the help.
    Visit Gamesigs.co.ukto create your own personalised signature using our generator,


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •