close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi form (not basic)

Thread began 8/07/2014 1:32 pm by Jason | Last modified 8/07/2014 2:19 pm by Jason Byrnes | 2327 views | 8 replies |

Jason

MySQLi form (not basic)

I attached 2 pages that I'm working with.

The form on the first page (kids_insert_shift.php) has a checkbox for recurring.

If the recurring checkbox is checked when the form is submitted, then I need the second page to open (kids_insert_shift_recurring.php).

I also need the second page to retrieve the ID number from the kids_program_shifts table row that was created when the kids_insert_shift.php form was submitted (It's an Auto Increment, so it doesn't exist until the first form is submitted), and put it in the hidden "ShiftID" field.

Attached Files
kids_insert_shift.php
kids_insert_shift_recurring.php
Sign in to reply to this post

Jason ByrnesWebAssist

you will need to hand code the redirect
<?php
if(isset($_POST["Recurring"]) && $_POST["Recurring"] == "1") {
header("Location: kids_insert_shift_recurring.php);
}
?>


in the insert behavior, ther is a section for Save ID In Session As, enter a name for the session variable there, then on the kids_insert_shift_recurring.php use the session to filter the recordset.

Sign in to reply to this post

Jason

I'm getting a syntax error with the redirect:

$InsertGoTo = "<?php if(isset($_POST"Recurring"]) && $_POST["Recurring"] == "1") {header("Location: kids_insert_shift_recurring.php);}?>";

Sign in to reply to this post

Jason ByrnesWebAssist

because that code cannot be used as the redirect in the insert behavior, it has to be added after the insert behavior.


you cannot do a conditional redirect directly in the insert behavior, you have to hand code that outside of the insert behavior.

Sign in to reply to this post

Jason

Ok, Thanks! (there was a missing quote also thought) lol

Sign in to reply to this post

Jason

Can you be more specific on how to filter the session id in the recordset on the kids_insert_shift_recurring.php page?

Sign in to reply to this post

Jason ByrnesWebAssist

create a recordset on the page, in the filtering section, select the ID column, use the equals comparison, for the filter type, select session, for the name enter the name you used in the insert for the Save ID isn Session named section.

Sign in to reply to this post

Jason

PERFECT! Thank you!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...