28, May 2012

Contact Page Question - webmaster forum

 
Webdigity webmaster forums
[ 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
Instabuck - The easy way to sell digital products online

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



« on: Apr 18, 2006, 12: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

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



« Reply #1 on: Apr 18, 2006, 01: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 or twitter

Last blog : Butterfly Marketing 2.0
Der Führer
I feel pretty...
***
Gender: Male
Posts: 184
481 credits
Members referred : 0



« Reply #2 on: Apr 18, 2006, 02: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Apr 18, 2006, 07: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

Der Führer
I feel pretty...
***
Gender: Male
Posts: 184
481 credits
Members referred : 0



« Reply #4 on: Apr 19, 2006, 12: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: 5799
46391 credits
Members referred : 3



« Reply #5 on: Apr 19, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Apr 19, 2006, 12: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

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Apr 19, 2006, 12: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

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



« Reply #8 on: Apr 19, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Der Führer
I feel pretty...
***
Gender: Male
Posts: 184
481 credits
Members referred : 0



« Reply #9 on: Apr 19, 2006, 12: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Apr 19, 2006, 12: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...

Der Führer
I feel pretty...
***
Gender: Male
Posts: 184
481 credits
Members referred : 0



« Reply #11 on: Apr 19, 2006, 01: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....

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?
May 28, 2012, 11:35:52 am





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!






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