Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-30-2004, 02:13 AM   #1 (permalink)
sarah31
Code Monkey
 
sarah31's Avatar
 
Join Date: May 2002
Location: canada
Posts: 55
sarah31 is on a distinguished road
php/frontpage webbot issue

hello. I recently changed a web site i am managing over to using php generated html pages. each page contains the changeable content with a static header and footer attached.

the problem comes with the contact page which is managed by a frontpage webbot (i was not the initial designer of this page but i have used it's code for awhile now when the page were just straight html files). that does not seem to be able to handle the .php extension.

Code:
<?php // cggroup index page

require ('templates/header.html');

?>

<div class="content">

<h1>Contact Us</h1>

<p></p>

<p>Tell us what you think about our website, our products, our organization, 
or anything else that comes to mind. We welcome all of your comments and suggestions. 
You can also call us at 1-541-341-1230</p><br>
<!-- webbot-action in the following tag is not valid HTML -->
	<form method="POST" onSubmit="" action="_vti_bin/shtml.exe/contactus.php" webbot-action="--WEBBOT-SELF--">
	<!--webbot bot="SaveResults" s-label-fields="TRUE" b-reverse-chronology="FALSE" s-email-format="TEXT/PRE" 
	b-email-label-fields="TRUE" s-date-format="%d %b %Y" s-time-format="%H:%M:%S" s-builtin-fields="REMOTE_NAME 
	REMOTE_USER HTTP_USER_AGENT Date Time" s-email-address="thecomicguys@comcast.net" startspan -->
	<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->

<h2>What kind of comment would you like to send?</h2>
    <input type="radio" name="MessageType" value="Complaint">Complaint
    <input type="radio" name="MessageType" value="Problem">Problem
    <input type="radio" checked name="MessageType" value="Suggestion">Suggestion
    <input type="radio" name="MessageType" value="Praise">Praise

  <h2>What about us do you want to comment on?</h2>
    <select name="Subject" size="1" multiple>
    <option selected>Web Site</option>
    <option selected>Company</option>
    <option selected>Services</option>
    <option selected>Certification</option>
    <option selected>Graders</option>
    <option selected>(Other)</option>
    </select>
	Other:
    <input type="text" size="26" maxlength="256" name="SubjectOther">

  <h2>Enter your comments in the space provided below:</h2><br>
  <textarea name="Comments" rows="5" cols="42"></textarea>
  <h2>Tell us how to get in touch with you:</h2>
    <table>
      <tr>
        <td>Name</td>
        <td><input type="text" size="35" maxlength="256" name="Username"></td>
      </tr>
      <tr>
        <td>E-mail</td>
        <td><input type="text" size="35" maxlength="256" name="UserEmail"></td>
      </tr>
      <tr>
        <td>Tel</td>
        <td><input type="text" size="35" maxlength="256" name="UserTel"></td>
      </tr>
      <tr>
        <td>Fax</td>
        <td><input type="text" size="35" maxlength="256" name="UserFAX"></td>
      </tr>
    </table>
  <input type="checkbox" name="ContactRequested" value="ContactRequested"> 
    Please contact me as soon as possible regarding this matter.<br>
  <input type="submit" value="Send to CGGroup">
  <input type="reset" value="Clear Form">
</form>

</div>

<?php //include the footer

require ('templates/footer.html');

?>
http://www.comicgradinggroup.com/contactus.php is the link to test the file out and see the error.

is it possible to use a php generated page for this contact form or will i have to use a straight html file for it to continue to work? (i have a normal html file being used in place of the .php page above)


<!-- edited to shorten horizontal scrolling -sde -->

Last edited by sde; 06-30-2004 at 06:03 AM.
sarah31 is offline   Reply With Quote
Old 06-30-2004, 03:17 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
Hmm... what is it supposed to do??

Is it supposed to send the info submitted as email, then you can use the mail() function in php.
If it's supposed to put it into a database, then simply let the script in the page store it in a database..
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 06-30-2004, 06:13 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
good question. what does front page do? does it email somebody? i have a feeling it might be, .. so if it does, .. you can just get rid of the front page crap and add your own mail functionality.

it would go something like this:
PHP Code:
<?
if($_POST){
  
$message "
    Message Type: "
.$_POST[MessageType]."
    
    Subject: "
.$_POST[Subject]."
    
    Subject Other: "
.$_POST[SubjectOther]."
    
    Comments: "
.$_POST[Comments]."
    
    Username: "
.$_POST[Username]."
    
    Email: "
.$_POST[UserEmail]."
    
    Telephone: "
.$_POST[UserTel]."
    
    Fax: "
.$_POST[UserFAX]."
    
    "
.(($_POST[ContactRequested)?" Please Contact Me":"")."
    
    
      $headers="
From: [email]messages@comicgradinggroup.com[/email]";
    
      mail("
admin@comicgradinggroup.com","New CGG Message",$message,$headers);
}
?>
ignore the [ email][/ email] tags in the $headers line. the forum is putting those in.
__________________
Mike
sde is offline   Reply With Quote
Old 06-30-2004, 09:41 AM   #4 (permalink)
sarah31
Code Monkey
 
sarah31's Avatar
 
Join Date: May 2002
Location: canada
Posts: 55
sarah31 is on a distinguished road
thanks. to answer both of you yes once the person hits the submit button it somehow evokes the frontpage mailbot which forwards the mail to the email address that is displayed in the commented section just below the tags that open the form.

why frontpage acts so mysteriously is beyond me. i assume it is because some of the people which use this ISP (?) may be more used to doing things in a wysiwyg environment and all the mysterious and kludgey-ness of that environment.

thanks for your responses and i will work on a less cumbersome php script as a replacement.
sarah31 is offline   Reply With Quote
Old 06-30-2004, 09:44 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
yes, it was probably made by people who only know how to use front page.

you can put the form itself in an if/else statement:
PHP Code:
if($_POST){
  
// ALL THE MAIL CODE ABOVE GOES HERE
  
echo "Thank You, your message will be ...";
}else{
  echo 
"<form method=post action=...>";
  
// the rest of the form here
}
?> 
that way it will show the form 1st, then when the post, it just says thank you and sends the email.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
perplexing issue with some calculations sarah31 PHP 9 07-12-2004 09:43 AM
CCS / Style issue sharmap HTML, XML, Javascript, AJAX 6 06-18-2004 08:03 AM


All times are GMT -8. The time now is 10:53 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting