Jump to content

anselk

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by anselk

  1. here is some code for a registration on a site. <?php $msg_subject = "TGR Registration"; $message = " <html> <head> <title>HTML email</title> </head> <body> Welcome to TGR!\r \r Please click the link below to activate your account, if the link below doesn't work please copy and paste the code below\r <a href='http://tgrdesigns.com/register.php?". $conf_code. "'>Register</a>\rCode: ". $conf_code. "\r\r Thank you,\r\r The TGR Design Team </body> </html>"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // More headers $headers .= 'From: <register@TGRDesigns.com>' . "\r\n"; mail($_POST['emailName'], $msg_subject, $message, $headers); echo "An email has been sent. Thank you"; ?> Try something like that... and you should be good.
  2. perhaps array_unique($foo); where $foo is the array that you are outputting from your DB. $new_row = array_unique($row); In your case
  3. would you mind posting your code? Helps people figure out what they might be doing wrong if they come across this. - cheers Ansel
  4. if that is your exact code Quantity: {$_POST['Quantity']}"; Total: {$_POST['Total']}"; is where your message ends first. you continued this throughout the rest of it. use of ' is fine, but once you use " it will end and your threw in your ; so php now thinks that message is really done and you are now passing all these variables out side of your string. However. It should still be going, but just not mailing you the whole "messages" variable.
  5. I declared it as global before the function and it didnt work.. didnt think to declare it as global inside.. ty I now realize that i have to define the variable first, not just as a global. (used to be good at php, came back forgot, but remember stuff still... so i think i get my self in more trouble. guh!) sweet, ty! FYI for anyone else, here is how it goes, on your included page, do your variable like normal $foobar = blah; function blah(){ global $foobar; // this makes it global to use now, even within the function you can just use $foobar } other page just call it like normal. <3 to all who helped. TY TY to mds1256 also, but i want it this way for a reason. never seen it done that way though. ;-)
  6. umm why all the {'s??? and the \n's and what not... are you trying to parse this for output? If so, i would use the explode() and implode functions perhaps. Also, dont do all of this in one message variable, maybe split it into header, body footer etc, $addyInfo = $name. "\n". $street. "\n". $zip; $BillinInfo = $name. "\n". $street. "\n". $zip. "\n". $CCard; Something like that. :-\ Then i would set all of you $_POST["Name"] data to $userName or some sort of easier variable or something of the sort. anywhoo little more info would be great
  7. I am trying to pass a variable from inside of a function in a file that is included eg include.php <? function noms(){ $foobar = "apples"; } ?> main.php <? include("include.php"); noms(); echo "these ". $foobar. " are most delicious... OM NOM NOM"; ?> I am essentially using a include file for a mysql connection and based on the connection outcome i am either setting a value to true or false. It prints "Connected succesfully" and what not just fine, but, after that it wont pass on the variables data. I know its the function because, it passes the data if i put the variable before the function... i just dont get it.. any help would be great. Thanks. Ansel
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.