patk24 Posted September 24, 2006 Share Posted September 24, 2006 ok i use this code for my website: [code]<form method='post'><div class="row"> Name<input name='Name' type='text' /><br /><div class="row"> Email<input name='Email' type='text' /><br /><div class="row"> Comment<input name='Comment' type='text' /><br /><div class="row" > <input type='submit' value=' Confirm Account' name='Confirm' /></form><?phpif(sizeof($_POST)>0){ $filename = "subscribers.txt"; $content = $_POST['Name']."\n".$_POST['Email']."\n".$_POST['Comment']."\n\n\n"; $fp = fopen($filename, "a"); $fw = fwrite( $fp, $content ); fclose( $fp ); if(!$fw) echo "Couldn't write the entry."; else echo "Successfully wrote to the file.";}?>[/code]when i load it through my php server (easyphp1.8) it works fine but when i load it to my site on freehostia.com it doenst work..i get the text boxes but underneath that is the php script all the letters and symbolys..wats wrong with wat im doing? Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/ Share on other sites More sharing options...
AndyB Posted September 24, 2006 Share Posted September 24, 2006 Are you saving the code as a .php file? Does freehostia.com offer php? Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-97457 Share on other sites More sharing options...
patk24 Posted September 24, 2006 Author Share Posted September 24, 2006 hey it does support php and i am saving it as a .php maybe i can try another hostwe'll see what happeneds Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-97459 Share on other sites More sharing options...
patk24 Posted September 25, 2006 Author Share Posted September 25, 2006 is anyone gonna help me? Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-98494 Share on other sites More sharing options...
HuggieBear Posted September 25, 2006 Share Posted September 25, 2006 Create a page that looks like this:[size=8pt][b]info.php[/b][/size][code]<?php phpinfo();?>[/code]Upload it to your server in ascii and make sure it has the correct permissions. Then open it in the browser and see what happens.If you get info about the php installation then it's worked ok, if not you need to contact your host and see if there's something they need to enable, or find out if they can offer you any support.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-98607 Share on other sites More sharing options...
redarrow Posted September 26, 2006 Share Posted September 26, 2006 try this ok[code]<form method='POST' action=""><div class="row"> Name<input name='Name' type='text' /><br /><div class="row"> Email<input name='Email' type='text' /><br /><div class="row"> Comment<input name='Comment' type='text' /><br /><div class="row" > <input type='submit' value=' Confirm Account' name='Confirm' /></form><?phpif($_POST['confirm']){ $filename = "subscribers.txt"; $content = $_POST['Name']."\n".$_POST['Email']."\n".$_POST['Comment']."\n\n\n"; $fp = fopen($filename, "a+"); $fw = fwrite( $fp, $content ); fclose( $fp ); if(!$fw) echo "Couldn't write the entry."; else echo "Successfully wrote to the file.";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-98643 Share on other sites More sharing options...
patk24 Posted September 27, 2006 Author Share Posted September 27, 2006 that dont work it says there an error with 'confirm' Quote Link to comment https://forums.phpfreaks.com/topic/21823-whys-this-happeneing/#findComment-99763 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.