icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » What did I screw up?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old August 31st, 2005, 10:03 PM   #1 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
6,815 posts
Gave thanks: 101
Thanked 199 times
What did I screw up?

Ok I think I must have screwed something up here.. here are the 2 pieces of code in this that work....

PHP Code:
@extract($_POST);
$shq stripslashes($encrs7);
$elcommie1 stripslashes($clwsna);
$plantype stripslashes($pt);
$plan stripslashes($plan);
$firstname stripslashes($firstname);
$lastname stripslashes($lastname);
$organization stripslashes($organization);
$address stripslashes($address);
$city stripslashes($city);
$state stripslashes($state);
$country stripslashes($country);
$zip stripslashes($zip);
$phone stripslashes($phone);
$emailaddy stripslashes($emailaddy);
$domain stripslashes($domain);
$notes stripslashes($notes);
$tosagree stripslashes($tosagree);
mail('sales@laogaming.com','Order submitted','Order submitted on LaoGaming.com. Below is the contents of the order. /n/n Plan Name: $plan \n\n Name: $firstname $laastname \n Organization: $organization \n Address: $address \n City: $city \n State: $state \n Country: $country \n Zip: $zip \n Phone: $phone \n Email: $emailaddy \n Notes: $notes \n TOS Agree? $tosagree \n\n\n Order has been submitted. Check for payment.','From: $firstname $lastname <$emailaddy>'); 
Yes I do have the php tags around it. And it actually does email me.. it just emails me all of the variable names and doesn't process the \n stuff. Now I grabbed that thing from another script that I know works.. so I must have screwed something up. And this code is all at the top of the page, before anything else happens.
__________________
Mountain Dew Knight
People should not be afraid of their governments. Governments should be afraid of their people.
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 10:12 PM   #2 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,087 posts
Gave thanks: 48
Thanked 131 times
You have variables inside single quotes, which doesn't parse them. Either change that to double quotes or concatenate them ('text'.$variable.'moretext').
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 10:15 PM   #3 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
6,815 posts
Gave thanks: 101
Thanked 199 times
aha i knew i changed something from the original. thank you
__________________
Mountain Dew Knight
People should not be afraid of their governments. Governments should be afraid of their people.
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 10:19 PM   #4 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,087 posts
Gave thanks: 48
Thanked 131 times
Welcome, that's what I'm here for...
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 10:27 PM   #5 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
6,815 posts
Gave thanks: 101
Thanked 199 times
That and for disposing of all of those dead turkeys
__________________
Mountain Dew Knight
People should not be afraid of their governments. Governments should be afraid of their people.
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 10:58 PM   #6 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,087 posts
Gave thanks: 48
Thanked 131 times
I thought we weren't going to mention that again... Thanks man.. they might be after me now.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 31st, 2005, 11:53 PM   #7 (permalink)
is scientific.
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,117 posts
Gave thanks: 8
Thanked 34 times
I made mine on afterbeing from pieces of a script I found online, and ideas from parts of Haugland's gallery registration page. :thumbsup
__________________
Quote:
Originally Posted by removed View Post
Internet Explorer rules.
David is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 1st, 2005, 12:39 PM   #8 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
Hey dew, rather than having a gajillion lines of codes for each var, why not do something like...
PHP Code:
foreach( $_POST as $key => $val ){
    $
$key stripslashes($val);

Just a thought; I haven't seen your form.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 1st, 2005, 3:19 PM   #9 (permalink)
Registered User
Comfy Contributor
 
Joined in Mar 2004
Lives in Herts, UK
Hosted on Webdev & SH108
111 posts
Gave thanks: 0
Thanked 0 times
one thing to watch with that method is that people don't start manipulating internal variables from other locations within your php that you don't want people to be able to change.

eg. if you have $username, you don't want people to send username as a post field as it would overwrite it. There's probably a good way of checking, though.
__________________
http://www.blamethepixel.com
Webdev (formerly Serenity)
zogger is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 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