Page 1 of 1

2 easy questions

Posted: Thu Sep 21, 2006 12:16 pm
by train
I have a form with a multi select. This is the code:

Code: Select all

td><select size="5" multiple="multiple" name="contact[]" id="custom_21" class="form-select required">
	<option value="Morning">Morning</option>
	<option value="Afternoon">Afternoon</option>
	<option value="Evening">Evening</option>
	<option value="Any Time">Any Time</option>
</select>
When this is submitted, I want PHP to go through and basically build a string like "Morning, Evening, Any Time" based on what is selected.

Also... how do I get a form to redirect someone to a thank you page when they have submitted the form?

I have this at the top of my form:

Code: Select all

<input name="postURL" type="hidden" value="http://www.wwm.org/thank_you_for_registering.php" />
<input name="cancelURL" type="hidden" value="http://www.wwm.org/registration_cancel.php" />
<input name="errorURL" type="hidden" value="http://www.wwm.org/registration_error.php" />
But I cant find the instructions that told me how to use it.

Help, please?

Oh yeah... one more thing (sorry):

How can I get the id of the last record inserted into MySQL? Right after I insert a record, I want to know what its id is (auto_increment).

I am sorry, yet grateful.


Thanks!!!!

Posted: Thu Sep 21, 2006 1:30 pm
by Burrito
first question:

that is passing an array so use implode() to make it a string.

second question:

you can use header() to redirect.

third question:

mysql_insert_id()