Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4339224
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:11:16+00:00 2026-05-21T11:11:16+00:00

I am trying to get a page to redirect after I click the button

  • 0

I am trying to get a page to redirect after I click the button and after the database updates but it doesnt seem to work.

I have a form that completes in itself, to cut down on the number of pages used (e.g no, thanks content has been edited” page) but after the content has been edited i wish to redirect back home.

form and database update:

    <div id = "errormsg">&nbsp;</div>
    <?php 

    echo "<table border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"7\" style=\"font-family:Arial;font-size:11px\">";
    echo "<tr>";
        echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "</tr>";
echo "<tr>";
        echo "<td><form name=\"confhome\" method=\"post\" action=\"\" onsubmit=\"return valText()\"><textarea name=\"tag\" cols=\"20\" rows=\"3\" id=\"tag\">$row[tagbrief]</textarea></td></tr>";
        echo "<tr><td><input type=\"submit\" value=\"Edit\"></form></td></tr>";
        echo "<tr></tr>";
        echo "</table><br/>";


    $tagbrief = $_POST['tag'];
    mysql_query("UPDATE quackedup SET tagbrief='$tagbrief' WHERE id='1'");
    ?>

JS validation for ref

<script type="text/javascript">
function valText(){

    var text = document.getElementById('tag');
    var div = document.getElementById('errormsg');

    var lets = /^[0-9a-zA-Z\s\-\'(\)\&\,\:\.\!\?]+$/;

    if((text.value == '') || (text.value == ' ')){
        div.innerHTML="<b>Please enter your changes</b>";
        text.focus();
        return false;}
    else if(text.value.match(lets)){
        div.innerHTML="<b>Content updated</b>";
        return true;}
else {
    return false;}

}

Any help appreciated, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:11:17+00:00Added an answer on May 21, 2026 at 11:11 am

    I’m not sure I fully follow but I would rejigger it so it was like this:

    <?
        if($_POST)
        {
            $tagbrief = mysql_real_escape_string($_POST['tag']);
            mysql_query("UPDATE quackedup SET tagbrief='$tagbrief' WHERE id='1'");
    
            header("Location: /path/to/script");
            exit;
        }
    ?>
    
    <div id = "errormsg">&nbsp;</div>
    <?php 
    
    echo "<table border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"7\" style=\"font-family:Arial;font-size:11px\">";
    echo "<tr>";
        echo "<td>&nbsp;</td>";
    echo "<td>&nbsp;</td>";
    echo "</tr>";
    echo "<tr>";
        echo "<td><form name=\"confhome\" method=\"post\" action=\"\" onsubmit=\"return valText()\"><textarea name=\"tag\" cols=\"20\" rows=\"3\" id=\"tag\">$row[tagbrief]</textarea></td></tr>";
        echo "<tr><td><input type=\"submit\" value=\"Edit\"></form></td></tr>";
        echo "<tr></tr>";
        echo "</table><br/>";
    ?>
    

    Now, it only updates the field if you are actually posting the form, and the form contents are escaped for the database (to prevent SQL injection). Just change the /path/to/script to be the path/url you want to go to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that i am trying to submit after the page loads
I'm trying to redirect users that login to their profile page but get the
I am trying to get a default query to implement upon page load but
I have a problem with a page where I am trying to get colorbox
I am trying to get a login form I have in django to only
I'm trying to get the previous page URL after I do a response write
I'm trying to redirect after page + images load: function redirect_on_load(){ //called from script
I'm trying to have a javascript alert, after a database interaction and before a
I'm trying to get an html page to display an XML file formatted with
iam trying to get all object's xpath's from loaded page via selenium something similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.