robotta1530 Posted February 10, 2010 Share Posted February 10, 2010 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> Link to comment https://forums.phpfreaks.com/topic/191701-help-needed-inserting-php-mailing-list-code-into-html-page/ Share on other sites More sharing options...
robotta1530 Posted February 11, 2010 Author Share Posted February 11, 2010 Any takers? Im definately fumbling around in the dark on this one. Link to comment https://forums.phpfreaks.com/topic/191701-help-needed-inserting-php-mailing-list-code-into-html-page/#findComment-1010664 Share on other sites More sharing options...
kla0005 Posted February 11, 2010 Share Posted February 11, 2010 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? Link to comment https://forums.phpfreaks.com/topic/191701-help-needed-inserting-php-mailing-list-code-into-html-page/#findComment-1010665 Share on other sites More sharing options...
robotta1530 Posted February 11, 2010 Author Share Posted February 11, 2010 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? Link to comment https://forums.phpfreaks.com/topic/191701-help-needed-inserting-php-mailing-list-code-into-html-page/#findComment-1010705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.