Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 01:46:08 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155504 Posts in 21710 Topics by 7736 Members
Latest Member: deenangle
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Using PHP Snippets in the code or HTML section of a page  (Read 1179 times)
nene

Offline Offline

Posts: 56


« on: June 19, 2009, 03:49:56 PM »

Hello,
Can someone help me. I want to put this codes in an HTML section at the backend.

<form action="<? echo $_POST['self']; ?>" method="post">
  <p>Your Full Name : <br />
    <input name="name" type="text">
    <br />
    <br />
Friend's Email Address : <br />
<input name="email" type="text">
</p>
  Your Message</br>
  <br>
    <label>
    <textarea name="msg" id="textarea" cols="45" rows="5"></textarea>
  </label>
    <br />
    <br />
    <input name="Send" type="submit" value="Send">
      </br>
</form>
<?
if (@$_POST['Send']=="Send")
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject = $name. " recommends this site !";
$message= "Hello, \n\n" .$name. " thought you might be interested in visiting the following website : \n\nYour - http://www.careplus-hhcl.com and sends the this message: ".$msg." \n\n\n\n\n\n\n\nNote: This message was not sent unsolicited.  It was sent through a form located at http://www.careplus-hhcl.com If you believe this message was received on error, please disregard it.";
$headers = 'From: care@careplus-hhcl.com' . "\r\n" . 'Reply-To: care@careplus-hhcl.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();


mail($email, $subject, $message, $headers);
echo "Your email was sent to: $email";
}
?>

It doesnt work. It give error when it is sent.

Thanks
Nene
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #1 on: June 19, 2009, 06:15:54 PM »

And why don't you post the error if you know already there is one?

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2295



WWW
« Reply #2 on: June 19, 2009, 09:21:18 PM »

The script has the address of the site is is being used.
Tried the function, and it lead me to this 404 page.
( http://careplus-hhcl.com/pages/<? echo $_POST['self']; ?> )

It is not possible tot include PHP commands in the WYSIWYG editor, the data will be sent as readable data and not interpreted by the PHP processor.


Logged

Professional WebsiteBaker Solutions
nene

Offline Offline

Posts: 56


« Reply #3 on: June 20, 2009, 05:04:31 PM »

So what do I do to make it work?
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #4 on: June 20, 2009, 09:59:57 PM »

try echoing it from a code page ... (or look at the various code page options on AMASP)

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!