Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need a little help with text carrying over to results
Old 12-29-2010, 09:48 PM Need a little help with text carrying over to results
Junior Talker

Posts: 1
Name: Jim
Trades: 0
I have 2 small problems I need help with. My first issue is I have an online form that people fill out and send to me. The form works perfectly. However I want to add some text to the results so that when I get e-mailed the results I know what they are. For example:

Currently this is what my e-mails look like:

NY
Yes
No

I want them to look like:

State: NY
Visited this site before: Yes
Person want newsletter: No

That way when I get the e-mail I know what all the answers are for. Here is the relevant code:

PHP Code:
mail("my@emailaddress.com"''.$subject$_SERVER['REMOTE_ADDR']."\n\n".$name."\n\n".$country."\n\n".$state."\n\n".$visited."\n\n".$hear."\n\n".$message"From: $from"); 
My second problem is making radio buttons required. I have text fields and dropdown menus all figured out but I can't figure out how to make radio buttons required. Here is both of the relevant code:

Here is the form part:

PHP Code:
Have you visited this site before?:<br />
Yes:<input type="radio" id="visited" value="Yes" name="visited">No:<input type="radio" id="visited" value="No" name="visited"
Here is the verification script (that doesn't work for these radio buttons):

PHP Code:
<form action="mailtome.php" method="post" name="form1" id="form1" style="margin:0px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px; width:350px;" onsubmit="MM_validateForm('from','','RisEmail','subject','','R','verif_box','','R','name','','R','visited','','R','country','','R');return document.MM_returnValue"
One more thing I should mention... The first question about having text appear with the form results I tried echo " "; and I also tried print " "; It seems to break the script when I put that in there. I must be doing something wrong.

Thanks so much for any help!

Last edited by casperboy77; 12-30-2010 at 10:17 AM.. Reason: Forgot php tags
casperboy77 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-30-2010, 01:45 AM Re: Need a little help with text carrying over to results
Banned

Posts: 36
Name: flemming
Trades: 0
Do try some sort of pluggin to add text or use some programming scripts.
flemming is offline
Reply With Quote
View Public Profile
 
Old 12-31-2010, 08:32 PM Re: Need a little help with text carrying over to results
PC Catastrophe's Avatar
Super Talker

Latest Blog Post:
QR Code Craze
Posts: 125
Name: Brandy
Location: Indiana
Trades: 0
You can try something like this instead for each aspect of the message:

$msg .= "State: $state\r\n\r\n";

I also believe your ids need to be different in your radio buttons to work properly. Ex. id="visited_y" for yes and id="visited_n" for no.

I hope this helps.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
PC Catastrophe is offline
Reply With Quote
View Public Profile Visit PC Catastrophe's homepage!
 
Old 12-31-2010, 08:38 PM Re: Need a little help with text carrying over to results
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
PHP Code:
mail("my@emailaddress.com"''.$subject$_SERVER['REMOTE_ADDR']."\n\nName: ".$name."\n\nCountry: ".$country."\n\nState: ".$state."\n\nVisited: ".$visited."\n\nHear: ".$hear."\n\nMessage: ".$message"From: $from"); 
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need a little help with text carrying over to results
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13849 seconds with 12 queries