SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old November 5th, 2002, 07:01 AM
bcp1961 bcp1961 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 3 bcp1961 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Having trouble with form mail php and htdoc

I'm having some trouble with a script for form mail, it generates it's own form.html and thankyou.html and the "post" references back to itself ("feedback.php").
This script works fine on a host where it does not have to be placed in an htdocs folder, but when in an htdocs folder it generates the form.html, but when "submit" is clicked it takes me back to a cleared form.html...?
I have tried using the entire url..."http://www..../feedback.php" but it still doesn't work.

On the host that it does work in, it will not worked when placed inside a folder...it apparently has to be on the root level.

I did change the chmod to 755. any sugguestions, I'm still pretty new to .php...

Reply With Quote
  #2  
Old November 8th, 2002, 03:16 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
That's weird... I haven't heard of anything like that before. Would you mind posting or attaching the code you're using?

Also, do the configurations from both servers differ at all?
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old November 9th, 2002, 09:25 AM
bcp1961 bcp1961 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 3 bcp1961 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here's the script

Thanks...I still haven't figured this out yet. Here's the script and I've attached the brief install instructions.

<?
/*
CHFEEDBACK.PHP Feedback Form PHP Script Ver 1.01.
Generated by thesitewizard.com's Feedback Form Wizard.
Copyright (c) 2000 by Christopher Heng. All rights reserved.
$Id: chfeedback0.txt 2.2 2002/07/11 07:43:47 chris Exp $
*/
// *************** USER CONFIGURABLE SECTION ******************
// Before this script will do anything useful, the following
// variables must be set.

// MANDATORY VARIABLES
// $sendto - email address where the feedback will be sent
// eg, $sendto = "yourname@yourdomain.com" ;
// $mainurl - the URL of your home page
// eg $mainurl = "http://www.yourdomain.com/" ;
// $subject - the subject line in the email sent by the feedback form
// eg $subject = "Feedback Form" ;

// OPTIONAL VARIABLES
// $formurl - the URL of your feedback form (optional)
// eg $formurl = "http://www.yourdomain.com/feedback.html" ;
// $thankyouurl - the URL of your thank you page (optional)
// eg $thankyouurl = "http://www.yourdomain.com/thanks.html" ;

$sendto = 'you@yoursite.com';
$mainurl = "http://www.yoursite.com";
$subject = "Feedback Form";
$formurl = "http://www.yoursite.com/form.html";
$thankyouurl = "http://www.yoursite.com/thankyou.html";

// The following will allow you to change the text on the
// Thank You page without having to draft a whole new page
// (since thank you messages are pretty standard as they come).
// This is OPTIONAL. Do not use this if you don't know what
// you're doing.
$thankyoumessage = "Thank you for your message. We appreciate \n" .
"your taking the time to write to us.\n" ;
$thankyoutitle = "Your Message Has Been Sent" ;

// ************ END OF USER CONFIGURABLE SECTION ***************

// ******************** MAIN FEEDBACK SCRIPT *****************
// Do not touch the following. You break it, you fix it.

function disable_caching ()
{
header( "Expires: Mon, 8 Dec 1999 05:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
}

if (!isset( $email ) || !isset( $realname ) || !isset( $comments )) {
if (empty( $formurl )) {
// No customized Feedback Form was indicated by $formurl.
// Use our default page.

// DO NOT CHANGE THE FOLLOWING: If you want to
// customize your feedback form, create a new file
// and put its url in $formurl above.
?>
<HTML>
<head>
<title>Feedback Form</title>
</head>
<body>
<h1>Feedback Form</h1>
<p>
<form method="post" action="/feedback.php">
<table border=0 width="100%">
<tr>
<td>Email address</td>
<td><input type="text" name="email" size="25"></td>
</tr>
<tr>
<td>Full name</td>
<td><input type="text" name="realname" size="25"></td>
</tr>
<tr>
<td valign="top"><br>Comments</td>
<td><textarea name="comments" cols="25" rows=15></textarea><br>&nbsp;<br></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="Send comments"><br>
<font size=1>Powered by <a href="http://www.thesitewizard.com/" target="_top">thesitewizard.com</a></font>
</td>
</tr>
</table>
</form>
</p>
<p>
Or <a href="<?echo $mainurl?>">click here</a> to return to the main page.
</p>
<hr>
This feedback script is copyright © 2000 by
<a href="http://www.thesitewizard.com/" target="_top">Christopher Heng</a>.
All rights reserved.<br>
Get a feedback form and other CGI/PHP scripts for
your website, free, at <a href="http://www.thesitewizard.com/" target="_top">thesitewizard.com</a>.
</body>
</html>
<?
exit ;
}
else {
header( "Location: $formurl" );
exit ;
}
}

if ((strlen($email) == 0)) {
// No email address given - make up a dummy one.
// This allows anonymous messages (which you can of course
// ignore if you like).
$email = "no_email_given" ;
}

// send the email now
$messageproper =
"This message was sent using from:\n" .
" $HTTP_REFERER\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;

mail($sendto, $subject, $messageproper,
"From: \"$realname\" <$email>\nX-Sender: CHFEEDBACK.PHP" );

// display thank you message
if (empty( $thankyouurl )) {
// No customized thank you page was set in $thankyouurl.
// Use our default.

// DO NOT CHANGE THE FOLLOWING: If you want to
// customize your feedback form, create a new file
// and put its url in $formurl above.

if (empty($thankyoutitle)) {
$thankyoutitle = "Your Message Has Been Sent" ;
}
if (empty($thankyoumessage)) {
$thankyoumessage = "Thank you for your message. We appreciate \n" .
"your taking the time to write to us.\n" ;
}

disable_caching();
?>
<HTML>
<head>
<title><?echo $thankyoutitle?></title>
</head>
<body>
<h1><?echo $thankyoutitle?></h1>
<p>
<?echo $thankyoumessage?>
</p>
<p>
Please <a href="<?echo $mainurl?>">click here</a> to
return to the main page.
</p>
<hr>
This feedback script is copyright © 2000 by
<a href="http://www.thesitewizard.com/" target="_top">Christopher Heng</a>.
All rights reserved.<br>
Get a feedback form and other CGI/PHP scripts for
your website, free, at <a href="http://www.thesitewizard.com/" target="_top">thesitewizard.com</a>.
</body>
</html>
<?
}
else {
header ( "Location: $thankyouurl" );
}

?>
Attached Files
File Type: txt install.txt (6.0 KB, 294 views)

Last edited by bcp1961 : November 9th, 2002 at 09:29 AM.

Reply With Quote
  #4  
Old November 9th, 2002, 01:56 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Are register_globals set to on or off (both servers)? I can't see why the one server requires the file to be in the root directory?

Reply With Quote
  #5  
Old November 10th, 2002, 12:52 PM
bcp1961 bcp1961 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 3 bcp1961 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Registered globals are set "on" on both of the servers.
Both servers are running PHP 4+.

Putting the file in the root directory, and the top level of htdoc folder was necessary on both servers, otherwise I couldn't access it at all. I haven't seen anything written about that in any of the forums or tutorials I have come acrossed in trying to figure this out....

Last edited by bcp1961 : November 10th, 2002 at 04:52 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Having trouble with form mail php and htdoc


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway