2 easy questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
train
Forum Commoner
Posts: 27
Joined: Wed Aug 16, 2006 3:58 pm
Contact:

2 easy questions

Post 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!!!!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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()
Post Reply