Jump to content


Photo

Why's this happeneing?


  • Please log in to reply
6 replies to this topic

#1 patk24

patk24
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 24 September 2006 - 12:54 AM

ok i use this code for my website:

<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>
<?php


if(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.";
}
?>


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?

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 September 2006 - 01:19 AM

Are you saving the code as a .php file?  Does freehostia.com offer php? 
Legend has it that reading the manual never killed anyone.
My site

#3 patk24

patk24
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 24 September 2006 - 01:24 AM

hey it does support php and i am saving it as a .php maybe i can try another host
we'll see what happeneds

#4 patk24

patk24
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 25 September 2006 - 07:52 PM

is anyone gonna help me?

#5 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 25 September 2006 - 11:12 PM

Create a page that looks like this:

info.php
<?php
  phpinfo();
?>

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.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 September 2006 - 12:24 AM

try this ok
<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>
<?php


if($_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.";
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 patk24

patk24
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 27 September 2006 - 06:49 PM

that dont work it says there an error with 'confirm'




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users