WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Using PHP Snippets in the code or HTML section of a page
  • Print
Pages: [1]   Go Down

Author Topic: Using PHP Snippets in the code or HTML section of a page  (Read 5540 times)

Offline nene

  • Posts: 59
Using PHP Snippets in the code or HTML section of a page
« on: June 19, 2009, 04: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

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Using PHP Snippets in the code or HTML section of a page
« Reply #1 on: June 19, 2009, 07:15:54 PM »
And why don't you post the error if you know already there is one?

cheers

Klaus
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Using PHP Snippets in the code or HTML section of a page
« Reply #2 on: June 19, 2009, 10: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
Dev4me - WebsiteBaker modules - WBhelp.org

Offline nene

  • Posts: 59
Re: Using PHP Snippets in the code or HTML section of a page
« Reply #3 on: June 20, 2009, 06:04:31 PM »
So what do I do to make it work?
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Using PHP Snippets in the code or HTML section of a page
« Reply #4 on: June 20, 2009, 10:59:57 PM »
try echoing it from a code page ... (or look at the various code page options on AMASP)

cheers

Klaus
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Using PHP Snippets in the code or HTML section of a page
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2