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
Old 01-31-2008, 09:00 AM Updating old script
Defies a Status

Posts: 1,606
Trades: 0
I should know what this is but can't pull it together. Fairly sure it relates to a register_globals issue.

What do I need to change to make this work?

PHP Code:
// snipped only the config info, the rest of the script is here.
 
$tomail = $adminemail;
 if($name && $email2){
  $subject = "$sitename -- Contact Page";
  while( list($key,$val) = each($_POST) ){
   $amsg .= "<b>$key</b> : $val<br>\n";
  }
  $headers = "From: $name <$email2>\r\nReply-To: $replyto\r\n";
  $headers .= "X-Sender: <$email2>\n"; 
  $headers .= "X-Mailer: PHP\n"; // mailer
  $headers .= "Return-Path: <$tomail>\n";  // Return path for errors
  $headers .= "Content-type: text/html\n\n";
  mail($tomail,$subject,$amsg, $headers);
  echo "<font color=red>Thank you, your message was successfully sent.</font><br>";
 }
?>
 <!--.start contact portion..-->
         
<p>
    <b> Please use this form to contact us. </b><br><br>
  
<form action="contactus.php" method="Post">
  <p align="center">
  <b>Name</b><input type=text name=name size=30 tabindex="1">
  <br>
  <span style="padding-left:5px;"><br>
  <b>Email</b></span><input type=input name=email2 size=30 tabindex="2">
  <br>
  <span style="padding-left:5px;"><br>
  <b>Questions/Comments</b><br>
  <textarea name="Questions" cols="39" rows="4" tabindex="3"></textarea>
  <br>
  </span> <br>
  <input type="hidden" name="subject" value="subject in subject line">
  <input type="submit" name="" value="Continue" tabindex="4" style="background-color:#e5e5e5; color:#000000; font-family:Verdana,Arial; font-weight: bold; font-size: 11px; border-left: 1 solid #a0a0a0; border-top: 1 solid #a0a0a0; border-right: 1 solid #000000; border-bottom: 1 solid #000000; padding: 2 2 2 2; outline: #a0a0a0 solid 2px;">
  <br>
</form>
  <!--.end contact portion..-->

<?
 
//include("include/footer.php");
?>
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-31-2008, 09:48 AM Re: Updating old script
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
With register_globals on your variables $name and $email2 are already defined within the global scope (being formed as part of $_POST array from the contact form script)

With register_globals off you need to define $name and $email2 with reference to scope.

$name = $_POST['name'];
$email2= $_POST['email2'];
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 01-31-2008, 01:51 PM Re: Updating old script
Defies a Status

Posts: 1,606
Trades: 0
Thanks! Maxxximus that took care of the problem.

Could not add to rep. I think I gave you some for another post the other day and now I have to spread it around.
__________________
Colbyt

Please login or register to view this content. Registration is FREE

Last edited by colbyt; 01-31-2008 at 01:52 PM..
colbyt is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Updating old script
 

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.41396 seconds with 12 queries