Bigbruin.com
Home :: Reviews & Articles ::
Forum :: Info :: :: Facebook :: Youtube :: RSS Feed
Search  :: Register :: Log in
Anyone know PHP?
Go To Page 1, 2  Next
Post new topic   Reply to topic    Bigbruin.com Forum Index -> Software
View previous topic :: View next topic  
Author Message
Modulok
Rated XXX


Joined: 19 Oct 2005
Posts: 2120
Location: New Jersey

PostPosted: Tue, 07 Nov 2006 15:44:09    Post Subject: Anyone know PHP? Reply with quote View Single Post

I'm wondering if anyone knows how to define variables in a PHP module for IIS. (Apache does this automatically, but the host for my work web site is Windows) I included a sample of the errors.

Code:
Notice: Undefined variable: msg in E:\InetPub\wwwroot\domain.com\survey\sendmailsurvey.php on line 17

Notice: Undefined variable: name in E:\InetPub\wwwroot\domain.com\survey\sendmailsurvey.php on line 35


and here is the whole php doc
Code:
<?

#**************************************************************************************************************************************

# PHP Send Mail Script                                                                                      *

# The following script takes the information that a users inputs into the form and is mailed to the addresse(s) listed below.   *

#**************************************************************************************************************************************



$MailTo = "user@domain.com"; //email the results are sent to sepearted with a comma

$MailSubject = "Customer Satisfaction Survey - 2006"; //subject field

$msg .= "

<script language=\"JavaScript\" type=\"text/JavaScript\">

alert(\"Your Information has been submitted.  Thank you for your time.\")

window.location=\"http://www.domain.com\";

</script>

";  //this is the javascript message that appears after the form is submitted.



/* Fields that are sent in the main body of the message.  These can be edited but must match the name field on the form. */



if ($name == ""){



}

else {

     $MailBody = "Name:\n-$name\n";

}

if ($company == ""){



}

else {

     $MailBody .= "Company:\n-$company\n";

}

if ($title == ""){



}

else {

     $MailBody .= "Title:\n-$title\n";

}




if ($address == ""){



}

else {

     $MailBody .= "Address:\n-$address\n";

}

if ($email == ""){



}
else {

     $MailBody .= "Email:\n-$email\n";

}

if ($telephone == ""){



}

else {

     $MailBody .= "Telephone Number:\n-$telephone\n";

}

if ($cust1 == ""){



}

else {

     $MailBody .= "Our ability to accurately process your order:\n-$cust1\n";

}


if ($cust2 == ""){



}

else {

     $MailBody .= "The ways questions / special requests are handled:\n-$cust2\n";

}


if ($time1 == ""){



}

else {

     $MailBody .= "Adequacy of our standard lead times:\n-$time1\n";

}


if ($time2 == ""){



}

else {

     $MailBody .= "Ability to deliver product on promise dates:\n-$time2\n";

}


if ($responsive == ""){



}

else {

     $MailBody .= "Adequacy of our response time:\n-$responsive\n";

}


if ($package == ""){



}

else {

     $MailBody .= "Ability to package products to prevent shipping damage:\n-$package\n";

}


if ($quality1 == ""){



}

else {

     $MailBody .= "Ability to consistently deliver defect free products:\n-$quality1\n";

}


if ($quality2 == ""){



}

else {

     $MailBody .= "Ability to deliver correct quantity:\n-$quality2\n";

}


if ($price1 == ""){



}

else {

     $MailBody .= "Is our product and service competitively priced compared to companies delivering similar products:\n-$price1\n";

}


if ($price2 == ""){



}

else {

     $MailBody .= "Are you receiving good value (product & service) for the price:\n-$price2\n";

}


if ($overall == ""){



}

else {

     $MailBody .= "How do you rate Weiss-Aug as a supplier:\n-$overall\n";

}


if ($improvement == ""){



}

else {

     $MailBody .= "Please tell us if there are any areas regarding our products & service in need of improvement:\n-$improvement\n";

}


if ($competitor1 == ""){



}

else {

     $MailBody .= "Competitor:\n-$competitor1\n";

}


if ($rating1 == ""){



}



else {

     $MailBody .= "Competitor Rating:\n-$rating1\n";

}

if ($competitor2 == ""){



}



else {

     $MailBody .= "Competitor:\n-$competitor2\n";

}

if ($rating2 == ""){



}



else {

     $MailBody .= "Competitor Rating:\n- $rating2\n";

}


if ($competitor3 == ""){



}

else {

     $MailBody .= "Competitor:\n-$competitor3\n";

}

if ($rating3 == ""){



}



else {

     $MailBody .= "Competitor Rating:\n-$rating3\n";

}


//Send message code

{

mail($MailTo, $MailSubject, $MailBody, "From: $email");

}

?>

<html>

<head>

<title>Thank You</title>

</head>



<body>

<? echo "$msg" ; ?>

</body>

</html>



Last edited by Modulok on Wed, 08 Nov 2006 13:07:01; edited 2 times in total
Back to top
View user's profile Send private message
Little Bruin
Boo Boo

Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket
Doctor Feelgood
Arrrrghh!


Joined: 07 Apr 2003
Posts: 20349
Location: New Jersey

PostPosted: Tue, 07 Nov 2006 15:44:45    Post Subject: Reply with quote View Single Post

what is on line 17 and 31?
Back to top
View user's profile Send private message Visit poster's website
Modulok
Rated XXX


Joined: 19 Oct 2005
Posts: 2120
Location: New Jersey

PostPosted: Tue, 07 Nov 2006 15:51:45    Post Subject: Reply with quote View Single Post

edited first post
Back to top
View user's profile Send private message
Blue|Fusion
Rated XXX


Joined: 30 May 2005
Posts: 441
Location: Cleveland, OH

PostPosted: Tue, 07 Nov 2006 16:39:47    Post Subject: Reply with quote View Single Post

Code:
$msg .= "


As far as I'm aware, you need to close the quotes (that seems to be a double quote) and take the period out before the = sign.

Code:
if ($name == ""){

if you're looking to see if this variable has been set, try if(isset($name)) instead.

By the looks of it, you may want register_globals on. If that's the case, reconsider the coding. Register_globals is usually looked down upon.

_________________
5 home-built PCs, ASUS A6Jc Laptop, and a PowerEdge 2650 - all running Gentoo. Now if only I can get a car and plane to run it. Take a look at my Gallery!
Back to top
View user's profile Send private message
Modulok
Rated XXX


Joined: 19 Oct 2005
Posts: 2120
Location: New Jersey

PostPosted: Tue, 07 Nov 2006 16:53:16    Post Subject: Reply with quote View Single Post

when the form is testing on my apache web host it works fine.

I thought it was register_globals but didn't turn out to be. the problem is that windows doesn't automatically interpret the variables like apache does.

if(isset($name)) doesn't help either

stupid Windows IIS!!!!
Back to top
View user's profile Send private message
craigp
Rated PG


Joined: 12 Oct 2006
Posts: 4
Location: Homer City, PA

PostPosted: Tue, 07 Nov 2006 20:02:49    Post Subject: Reply with quote View Single Post

Soo is this that half assed php mail thing I did years ago when I was first learning php and didn't know much about security
Back to top
View user's profile Send private message
Modulok
Rated XXX


Joined: 19 Oct 2005
Posts: 2120
Location: New Jersey

PostPosted: Tue, 07 Nov 2006 20:34:16    Post Subject: Reply with quote View Single Post

hehe, I just modify it when I need to make a form...any suggestions PHP master?
Back to top
View user's profile Send private message
Little Bruin
Boo Boo

Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket
Blue|Fusion
Rated XXX


Joined: 30 May 2005
Posts: 441
Location: Cleveland, OH

PostPosted: Tue, 07 Nov 2006 21:10:21    Post Subject: Reply with quote View Single Post

Can we see the full PHP script?
_________________
5 home-built PCs, ASUS A6Jc Laptop, and a PowerEdge 2650 - all running Gentoo. Now if only I can get a car and plane to run it. Take a look at my Gallery!
Back to top
View user's profile Send private message
Modulok
Rated XXX


Joined: 19 Oct 2005
Posts: 2120
Location: New Jersey

PostPosted: Wed, 08 Nov 2006 13:07:58    Post Subject: Reply with quote View Single Post

updated first post with entire php script.
Back to top
View user's profile Send private message
Blue|Fusion
Rated XXX


Joined: 30 May 2005
Posts: 441
Location: Cleveland, OH

PostPosted: Wed, 08 Nov 2006 13:39:38    Post Subject: Reply with quote View Single Post

Try setting the variables since register_globals is not getting the info from IIS.

Code:
$name = $_POST['name'];
$company = $_POST['company'];
$address = $_POST['address'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$cust1 = $_POST['cust1'];
etc...


This will fetch the POST data from the submitted form and assign it to a variable. Just put that above the rest of the stuff and see what happens.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Bigbruin.com Forum Index -> Software All times are GMT - 4 Hours
Go To Page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Contact Us :: On Facebook :: On Youtube :: Newsletter :: RSS Feed :: FAQ :: Links :: Sponsors :: Privacy Policy
Copyright © 2000 - 2023 Bigbruin.com - All rights reserved