Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I redirect to another page after mysqli runs succesffully?
    primarykey
    data
    text
    <p>I have written the following in my reginsert.php. The goal is to take the variables from index.php and insert into my regdata table. After successful insert is completed, I want the user redirected to thank_you.html. Where/how would I incorporate that in the following code block?</p> <pre><code>&lt;?php $Database = array( "Host" =&gt; 'myhost', "User" =&gt; 'myuser', "Password" =&gt; 'mypass', "Name" =&gt; 'mydb' ); if ($mysqli-&gt;connect_error) { $error = true; echo $mysqli-&gt;connect_error; } else $mysqli = new mysqli($Database['Host'], $Database['User'], $Database['Password'], $Database['Name']); $stmt=mysqli-&gt;prepare("INSERT into regdata (Username,Password,Confpassword,Status,Salutation,Firstname,Lastname,Jobtitle,Telephone,Companyname,industry,Address,City,Country,State,PostalCode,Regtype,Interests,Hdsprovider,PasswordRemindQuestion,PasswordRemindAnswer) VALUES( $_POST['email_address'], $_POST['create_password'], $_POST['confirm_password'], '0', $_POST['salutation2'], $_POST['first_naem'], $_POST['last_name'], $_POST['job_title'], $_POST['telephone'], $_POST['company_name'], $_POST['industry'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['country'], $_POST['state'], $_POST['postal_code'], $_POST['partner_customer_other'], $_POST['interests'], $_POST['provider_partner'], $_POST['password_reminder_question'], $_POST['password_reminder_answer'] )"); $stmt-&gt;execute(); $stmt-&gt;close(); ?&gt; </code></pre> <p>Also, note that my table field regid is a primary key and status is default to 0. Do I need to add regid as part of my insert statement?</p> <p>Thanks, Sid</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload