HNX Posted November 24, 2007 Share Posted November 24, 2007 ok so i made a contact form and i added php with it and this is my code <?php // Contact subject $subject ="$subject"; // Details $message="$detail"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='myemail@gmail.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "Your message has been received. A Response will be sent to you as soon as possible. Thank You!"; } else { echo "ERROR"; } ?> and when i preview my html page and submit some in to test it it works, this is what it says: "; // Enter your email address $to ='noorihamayun@gmail.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "Your message has been received. A Response will be sent to you as soon as possible. Thank You!"; } else { echo "ERROR"; } ?> is someone could please help me it would be VERY appreciated Thanks, HNX Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 You have saved the file with a .php file extension? and that your website has PHP enabled? Also can define how you preview it? Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 the file is saved as a php but i donnu if php is enabled....how do i enable it??? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 24, 2007 Share Posted November 24, 2007 Write a small script and run it to see if you get output. <?php phpinfo(); ?> Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 what the?!...a bit more info please Lol i am a complete noob with php Quote Link to comment Share on other sites More sharing options...
revraz Posted November 24, 2007 Share Posted November 24, 2007 Copy and paste what I did into a new info.php file, save it, run it from your browser. What is the result? Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 blank page hey can i have ur email, this way u could help me directly? Regards, HNX Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 How are you running your PHP file? Please describe the process in which you run your html/php files. Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 well i made a website (completly html) and i am using a contact us form and i copid someone else's contact and php files (its actually some kinda hackin) and when i changed the preferences and tried if everything works ...it doesnt:s Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 Who is the webhost that hosts your site? You might want to contact your webhost for support as to why your php files are not running. Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 euh...i dont have a host yet..... why? doesnt php work when u preview it without a host??? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 euh...i dont have a host yet..... why doesnt php work when u preview it without a host??? So are you running your files directly from your PC directly in your browser? and the address bar reads something like: file:///path/to/your/file or C:/path/to/your/file Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 euh..yeah i think so...hey can u i have ur email so you can help me faster Lol Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 In that case theres your problem. PHP is a server side language. It is not a client side language like HTML/Javascript/CSS which your browser can read. In order for your to run your PHP files you'll need to install a http server configured with PHP. If you are new to PHP then I suggest WAMP (http://www.wampserver.com). WAMP is a pre-configured package which will setup Apache and PHP (and MySQL which is a database) for you so you can run your PHP scripts. Also I recommend you to watch the first video on this site for installing and how to use wamp Quote Link to comment Share on other sites More sharing options...
HNX Posted November 24, 2007 Author Share Posted November 24, 2007 wow dude thank you very much Lol ill come back t0 yoou once i finished everything to say thanks again and can i have ur email??? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 24, 2007 Share Posted November 24, 2007 wow dude thank you very much Lol ill come back t0 yoou once i finished everything to say thanks again and can i have ur email??? Nope. I do not give out email/IM or any other contact details over the net. Only to friends and family sorry. Once you have reached 10 or more posts you'll be able to PM. You can contact me via PM if you wish. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 25, 2007 Share Posted November 25, 2007 It's easier to just post your questions here, that way you can get a variety of replies. Quote Link to comment 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.