22, November 2008

Contact Page Question - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Contact Page Question
« previous next »
Pages: [1] Print

Author Topic: Contact Page Question  (Read 1102 times)
Der Führer
I feel pretty...
***
Gender: Male
Posts: 183
471 credits
Members referred : 0



« on: Apr 18, 2006, 01:59:20 AM »

I've had this contact page up and running for a while and I decided to add a Select menu. The problem is i have no idea how to do this in PHP so it shows up on the email it sends me. I'd also like to try to get the feature where it send the person back to my form if the don't select something besides the "Select One"... I know this is a lot to ask so if someone could point me to a tutorial or have a look at the zip I post I would really appreciate it.

http://silent.2dollarhost.net/contact.zip Visit through proxy

Thanks
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8250
42487 credits
Members referred : 3



« Reply #1 on: Apr 18, 2006, 02:06:15 AM »

It is better to post the code instead of a zip file Wink

About your problem, I can't really understand what you ask.

You want to add some extra variables in the mailing?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Der Führer
I feel pretty...
***
Gender: Male
Posts: 183
471 credits
Members referred : 0



« Reply #2 on: Apr 18, 2006, 03:41:12 AM »

they way the php is set up now is... it takes what the person types in each text box on the html file and sends it to my email address. What I am trying to do is make the Select thing show up on my email form. I don't know how you would do that in html for it to work with the php other than to give each option a different <label> and if i did that how would i coee it in th php file.

do you get what I am tryin to do?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Apr 18, 2006, 08:55:16 AM »

Hello,

The best way is to post the form with $_SERVER['PHP_SELF'] as action inside the form element.
Next, place all the form validation at the top of the same page.
If all required fields are filled use this to call the mail script:
Code:
header("Location: handle_contact.php");

check this simple script (example) to validate the form:
http://www.finalwebsites.com/snippets.php?id=24 Visit through proxy


Last blog : Just a better Internet portal provided by Google
Der Führer
I feel pretty...
***
Gender: Male
Posts: 183
471 credits
Members referred : 0



« Reply #4 on: Apr 19, 2006, 01:23:03 AM »

Hmm that may work but I am still stuck on trying to get the <select> thing to show up on my the email the php script sends to me
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8250
42487 credits
Members referred : 3



« Reply #5 on: Apr 19, 2006, 01:28:11 AM »

This is how it works in general :

Let's say that you have this :

Code:

<select name="mysel">
<option value="first">This is the first option</option>
<option value="second">This is the second option</option>
</select>


If you click on the second option php will have a variable called $mysel and the contents of this variable will be "second" ( $mysel = 'second)

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Apr 19, 2006, 01:29:40 AM »

sometimes its the easy stuff  Grin

your html is bad:
Quote
<select class="drop" name="subject">
<option selected>Select One
<option>Comments/Concerns
<option>Graphic Design
<option>Hosting Services
<option>Web Development
</select>

check the options there is no value attribute check the w3: http://www.w3.org/TR/html401/interact/forms.html#edef-SELECT Visit through proxy


Last blog : Just a better Internet portal provided by Google
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Apr 19, 2006, 01:30:37 AM »

This is how it works in general :

Let's say that you have this :

Code:

<select name="mysel">
<option value="first">This is the first option</option>
<option value="second">This is the second option</option>
</select>


If you click on the second option php will have a variable called $mysel and the contents of this variable will be "second" ( $mysel = 'second)

you was some seconds to fast Nikolas Cheesy


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8250
42487 credits
Members referred : 3



« Reply #8 on: Apr 19, 2006, 01:32:31 AM »

Hehehe. I guess this is the meaning of a helpfull community Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Der Führer
I feel pretty...
***
Gender: Male
Posts: 183
471 credits
Members referred : 0



« Reply #9 on: Apr 19, 2006, 01:47:30 AM »

so would I leave the php script as it is or do I have to modify that?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Apr 19, 2006, 01:49:59 AM »

so would I leave the php script as it is or do I have to modify that?
check my post the html code is the problem...


Last blog : Just a better Internet portal provided by Google
Der Führer
I feel pretty...
***
Gender: Male
Posts: 183
471 credits
Members referred : 0



« Reply #11 on: Apr 19, 2006, 02:26:03 AM »

Aight thanks agian guys I got it workin
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2301
Tags : php html tutorials email Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Contact Page Question
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 10:23:04 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.741
Total Topics: 7.651
Total Members: 4.398
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: egseopro

38 Guests, 3 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.