Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
When testing my contact form I get this message:
Old 08-28-2009, 11:59 AM When testing my contact form I get this message:
Experienced Talker

Posts: 31
Name: Rachel
Trades: 0
Firefox can't find the file at /C:/Users/Rachel/Documents/New Site/contact.php.

My form is from this tutorial ( i will personalize it once I can get it working)

My contact page is called page5.html and has this code:
Quote:
<!DOCTYPE HTML PUBLIC
"-HTTP:WSC??DTD HTML 4.01 Transitional//EN
"http://www.w3.org/TR/xhtml1-transitional.dtd">
<html xmlns="http xmlnx="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type"text/css
href="main.css" />
<title>
Rachel Clare's Services
</title>
</head>
<body>
<div id="content">
<!-- Begin Header -->
<div id="header">
</div>

<!-- Begin Left Column -->
<div id="leftcolumn">
<div id="navcontainer">
<h2>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="page2.html">Portfolio</a></li>
<li><a href="page3.html">About</a></li>
<li><a href="page4.html">Services</a></li>
<li><a href="page5.html">Contact</a></li>
</ul>
</div>

<br><br><br>
<form method="post" action="contact.php">

Nickname:<input type="text" name="nickname" />
<br/><br/>

Your e-mail: <input type="text" name="visitormail" />
<br/><br/>

Topic: <input type="text" name="topic" />
<br/><br/>

Message: <br/><textarea name="message" rows="10" cols="50"></textarea>
<br/><br/>

<input type="submit" value="Send" />
</form>

</div>
<!-- End Left Column -->
<!-- End Header -->
<!-- Begin Footer -->
<div id="footer">
Copyright © Rachel Clare Photography 2009
</div>
<!-- End Footer -->
</div>
</body>

</html>
and my contact.php file is in the same folder as the page5.html and the code is ( I left the comments in from the tutorial so I know what it all means-I didnt think this would cause the problem this cause the problem?:
Quote:
<?php
//first we check if $_POST['nickname'] , $_POST['visitormail'] , $_POST['topic'] , $_POST['message'] exist, then we check if they are empty or not.
if (!empty($_POST['nickname']) && !empty($_POST['visitormail']) && !empty($_POST['topic']) && !empty($_POST['message']))
{
//We deactivate possible html tags
$nickname = htmlspecialchars($_POST['nickname']);
$visitormail = htmlspecialchars($_POST['visitormail']);
$topic = htmlspecialchars($_POST['topic']);
$message = htmlspecialchars($_POST['message']);

//We transform new lines into <br>s
$message = nl2br($message);

//we define the variable:
//$mail contains the email address of the recipient (admin)
$mail = 'rachelsne@hotmail.com';

//$topic is the topic of the message
$topic = '' . $topic . '';

//Then $mess is the message
$mess = '<html><body>Message from ' . $pseudo . ' --> ' . $visitormail . '<br/><br/>' . $message . '</body></html>';

//These headers are very important to send html mail using HTML
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

//Finally we send the mail thanks to the mail() function
mail($mail, $topic, $mess, $headers);

//and we say to the visitor that the mail has been send
echo 'Your message has been sent !';
?>


What am I missing or doing wrong? or does it only work when I am actuall live through my host? right now I am just opening test pages in firefox
Rachelsne is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-28-2009, 12:51 PM Re: When testing my contact form I get this message:
Experienced Talker

Posts: 31
Name: Rachel
Trades: 0
Mods Cab You Move This To The Php Forum, Thanks.
__________________

Please login or register to view this content. Registration is FREE
that I am building for my self, any tips and tricks appreciated.
Rachelsne is offline
Reply With Quote
View Public Profile
 
Old 08-28-2009, 12:52 PM Re: When testing my contact form I get this message:
prasanthmj's Avatar
Experienced Talker

Posts: 42
Name: Prasanth
Trades: 0
It won't work if you open the file locally. You have to upload it to you a web server that supports php.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
prasanthmj is offline
Reply With Quote
View Public Profile
 
Old 09-03-2009, 08:29 PM Re: When testing my contact form I get this message:
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
Quote:
Originally Posted by Rachelsne View Post
Firefox can't find the file at /C:/Users/Rachel/Documents/New Site/contact.php.

My form is from this tutorial ( i will personalize it once I can get it working)

My contact page is called page5.html and has this code:
and my contact.php file is in the same folder as the page5.html and the code is ( I left the comments in from the tutorial so I know what it all means-I didnt think this would cause the problem this cause the problem?:

What am I missing or doing wrong? or does it only work when I am actuall live through my host? right now I am just opening test pages in firefox

live server that executes php or have a software running on ur desktop like WAMP that makes your computer turn into a server
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 09-06-2009, 07:47 PM Re: When testing my contact form I get this message:
Experienced Talker

Posts: 31
Name: Rachel
Trades: 0
thanks for the info!
__________________

Please login or register to view this content. Registration is FREE
that I am building for my self, any tips and tricks appreciated.
Rachelsne is offline
Reply With Quote
View Public Profile
 
Old 09-06-2009, 10:40 PM Re: When testing my contact form I get this message:
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
Php is a server side language and you MUST execute it on the server. It will NOT run locally.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to When testing my contact form I get this message:
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.91827 seconds with 12 queries