Jump to content

form code expansion help please


paulmo

Recommended Posts

You put that line wherever makes sense, if you want to convert the string before you insert it in the database then put it before you build the query, and change the variable name to be whatever you want to convert. I don't know what you mean about radio field variables not being editable.

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

for the moment i'm leaving database/form interaction as it's beyond my comprehension. found a js for the cap first letter that works. now trying to add variables including message text and radio button values to e-mail form. but the extra variables are bogging down the mail, it returns with "5 variables allowed and" i'm "using 6." how to get extra field values sent to email message body?

<?php $to = "xxx@yahoo.com"; $subject = "Interactive"; $email = $_REQUEST['email']; $message = $_REQUEST['message']; $theme_user = $_REQUEST['theme_user'];$accept = $_REQUEST['accept'];$headers = "From: $email"; $sent = mail($to, $subject, $message, $theme_user, $accept, $headers); if($sent) header('Location: redirect.php');  else {print "An error occurred during send; please try again."; }?>

Link to comment
Share on other sites

The mail function does not take everything you want to put in the mail as an argument, that is not how functions work in PHP. You send the mail function a minimum of 3 arguments and a maximum of 5, this is the definition:bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )The last 2 are optional. Anything that you want in the body of the mail goes into the third argument, the $message argument. You don't send the mail function one argument per whatever you want to show up, it takes one argument total for the entire email body, so you need to build that body text before you call the mail function.

Link to comment
Share on other sites

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
tried this and was getting parse error around the "," was expecting "[". played around with it, decided to just post radio button value to the subject line of e-mail which is working. also want to send a shout out of thanks to yourself justsomeguy and chris jesusdisciple for getting me going on my web site. now that it's at a place where i'm relatively happy, was looking at the php code and all the aspects you've helped me with. what's been done offers a lot to examine for similar ideas in the future.
Link to comment
Share on other sites

  • 7 months later...

if justsomeguy is around here...i'm interested in retrieving user info based on ip address/location, which could in turn call up location-specific google (or similar) weather and city/town. i'd have cases for that information (like "if 'windy' then 'the trees are bowing in the wind" or "if <30 degrees then 'bring a hat and gloves today'" and for location: "if boston then 'walk along wharf street'" and i'd incorporate that information in my previously existing code cases that you helped me with (for dark/grey/light; season/time). how to retrieve this kind of information, incorporate and make cases (?) for?thanks—paulmo

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...