Jump to content

Help needed inserting .php mailing list code into html page


robotta1530

Recommended Posts

Hi, I wonder if you could help me integrate the following code into my index page. I have inserted it and changed the file to .php but none of the code looks active, ie not coloured and the email.txt file I have created does not get updated. Also when i view the page in a browser part of the code appears to the left - ,");?>

 

This is the original webpage that i want to add the code to;

www.robertlang.co.uk/index2.htm

 

Any help would be very welcome

 

 

The mailing list code is:

 

<?php

$database = "emails.txt";

$file = fopen($database, "a+");

$size = filesize($database);

$name = $_POST['name'];

$email = $_POST['email'];

if($_POST['submit']) fwrite($file, "\"$name\" <$email>,");

?>

 

<form method="post">

<p align="center"><b><font face="Arial">Email</font></b>: <input type="text" name="email" size="20"><input type="submit" value="Subscribe" name="submit">

</p>

<p align="center"><br /><br />

 </p>

 

</form>

Hi, I wonder if you could help me integrate the following code into my index page. I have inserted it and changed the file to .php but none of the code looks active, ie not coloured and the email.txt file I have created does not get updated. Also when i view the page in a browser part of the code appears to the left - ,");?>

 

This is the original webpage that i want to add the code to;

www.robertlang.co.uk/index2.htm

 

Any help would be very welcome

 

 

The mailing list code is:

 

<?php

$database = "emails.txt";

$file = fopen($database, "a+");

$size = filesize($database);

$name = $_POST['name'];

$email = $_POST['email'];

if($_POST['submit']) fwrite($file, "\"$name\" <$email>,");

?>

 

<form method="post">

<p align="center"><b><font face="Arial">Email</font></b>: <input type="text" name="email" size="20"><input type="submit" value="Subscribe" name="submit">

</p>

<p align="center"><br /><br />

 </p>

 

</form>

 

I just tryed the code that you have createt on my own server, and for me it worked successfully?

I typed in first: myemail

and after 'harj' <--..

And the emails file does know contain:

"" <[email protected]>,"" <harj>,

 

So whats yur problem, i dont get it?

As I said, i know next to nothing about this. I presumed that i could just pop the code into my current html file, change the extension to .php and voila! For some reason this is not the case, so i was looking for some advice and steps to take to sort the error out. I thought that there may have been something missing, but clearly not as it worked for you.

 

Did you modify anything in the code?

Archived

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

×
×
  • 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.