Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 4:21 PM   #1
Wm
 
Wm's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data

I'm not sure why this isn't working, but it's giving me no output. I have a
form which requests email and city to pull up a listing, then Email that
address with their password. I'm doing an extract($_POST) to get the data
from the previous form. When I test it I enter a known invalid email/city
combination, yet I get a blank area where the first message should be. This
is what's not working:

include('dbconnect.php');
if (Submit == "Remind Me") {
$query="SELECT ID,firstname,city,email,passwd from artists
WHERE email='$email' AND city='$city'";
$result=mysql_query($query) or die(mysql_error("Could not execute
query."));
// verify that the Email/city combination exists
if (mysql_num_rows($result) < 1) {
echo "<P>&nbsp;</P>
We cannot find that Email address and city combination in our
database.
Please use your browser's \"Back\" button and check your entry.<BR>
For best results, cut and paste the information from your listing to
ensure
that you don't have any typographical errors. If you continue to
have
difficulties, please <A HREF=\"mailto:Webmaster@domain.com\">
Email the Webmaster</A>.<BR>";
//break 2; (commented out in case it was causing the problem)
} else {
// pull listing from database
while($row = mysql_fetch_array($result)) {
$artistID = $row['artistID'];
$firstname = $row['firstname'];
$city= $row['city'];
$email = $row['email'];
$passwd = $row['passwd'];
// generate Email
$headers .= "From: Webmaster <Webmaster@domain.com>\n";
$headers .= "To: $firstname <$email>\n";
$headers .= "X-Sender: <Webmaster@domain.com>\n";
$headers .= "X-Mailer: domain.com\n"; //mailer
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <Webmaster@domain.com>\n";
//Uncomment this to send html format
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$message = "
...message text is here...
mail($to......);
}


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 07-01-2007, 4:21 PM   #2
Andy Hassall
 
Andy Hassall's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data

On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:

>I'm not sure why this isn't working, but it's giving me no output.
>
> if (Submit == "Remind Me") {


If you'd had error_reporting turned up high enough, you'd have got a warning
similar to:

Use of undefined constant Submit, assuming string 'Submit'.

Since 'Submit' != "Remind Me", only the 'else' branch would ever execute.

> } else {
> // pull listing from database
> while($row = mysql_fetch_array($result)) {


But $result was only defined inside the other branch of the if; surely it's
undefined here.

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:21 PM   #3
Wm
 
Wm's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data

"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com...
> On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:
>
> >I'm not sure why this isn't working, but it's giving me no output.
> >
> > if (Submit == "Remind Me") {

>
> If you'd had error_reporting turned up high enough, you'd have got a

warning
> similar to:
>
> Use of undefined constant Submit, assuming string 'Submit'.
>
> Since 'Submit' != "Remind Me", only the 'else' branch would ever execute.
>


The form that submits the data to this page has a value of "Remind Me" on
the submit button. I was trying to verify that the data I was dealing with
was submitted from that form. If they clicked the submit button on the first
page, this SHOULD be true -- it works with all my other sites.

> > } else {
> > // pull listing from database
> > while($row = mysql_fetch_array($result)) {

>
> But $result was only defined inside the other branch of the if; surely

it's
> undefined here.
>


True -- maybe I could copy the query down...? but that shouldn't be
necessary if the data is coming from the submitted form, right?

Wm


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:21 PM   #4
Andy Hassall
 
Andy Hassall's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data

On Sun, 10 Aug 2003 18:31:26 GMT, "Wm" <LAshooter@hotmail.com> wrote:

>"Andy Hassall" <andy@andyh.co.uk> wrote in message
>news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com.. .
>> On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:
>>
>> >I'm not sure why this isn't working, but it's giving me no output.
>> >
>> > if (Submit == "Remind Me") {

>>
>> If you'd had error_reporting turned up high enough, you'd have got a

>warning
>> similar to:
>>
>> Use of undefined constant Submit, assuming string 'Submit'.
>>
>> Since 'Submit' != "Remind Me", only the 'else' branch would ever execute.
>>

>
>The form that submits the data to this page has a value of "Remind Me" on
>the submit button. I was trying to verify that the data I was dealing with
>was submitted from that form. If they clicked the submit button on the first
>page, this SHOULD be true -- it works with all my other sites.


No, read it again. You've missed the $.

>> > } else {
>> > // pull listing from database
>> > while($row = mysql_fetch_array($result)) {

>>
>> But $result was only defined inside the other branch of the if; surely

>it's
>> undefined here.

>
>True -- maybe I could copy the query down...? but that shouldn't be
>necessary if the data is coming from the submitted form, right?


Don't know, depends what you're passing.

But it sounds like you need to put error_reporting to E_ALL as both of these
should have displayed visible warnings.

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:21 PM   #5
Tom Thackrey
 
Tom Thackrey's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data


On 10-Aug-2003, "Wm" <LAshooter@hotmail.com> wrote:

> "Andy Hassall" <andy@andyh.co.uk> wrote in message
> news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com...
> > On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:
> >
> > >I'm not sure why this isn't working, but it's giving me no output.
> > >
> > > if (Submit == "Remind Me") {

> >
> > If you'd had error_reporting turned up high enough, you'd have got a

> warning
> > similar to:
> >
> > Use of undefined constant Submit, assuming string 'Submit'.
> >
> > Since 'Submit' != "Remind Me", only the 'else' branch would ever
> > execute.
> >

>
> The form that submits the data to this page has a value of "Remind Me" on
> the submit button. I was trying to verify that the data I was dealing with
> was submitted from that form. If they clicked the submit button on the
> first
> page, this SHOULD be true -- it works with all my other sites.


Andy was trying to tell you that if (Submit should be if ($Submit

--
Tom Thackrey
www.creative-light.com
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:22 PM   #6
Wm
 
Wm's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP problem retrieving data

That was it -- ok, note to self: don't work anymore without coffee. THANK
YOU guys!!!

Wm

"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:uq4djv08aa3m9h28inci9nm2i3uoq35e4t@4ax.com...
> On Sun, 10 Aug 2003 18:31:26 GMT, "Wm" <LAshooter@hotmail.com> wrote:
>
> >"Andy Hassall" <andy@andyh.co.uk> wrote in message
> >news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com.. .
> >> On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:
> >>
> >> >I'm not sure why this isn't working, but it's giving me no output.
> >> >
> >> > if (Submit == "Remind Me") {
> >>
> >> If you'd had error_reporting turned up high enough, you'd have got a

> >warning
> >> similar to:
> >>
> >> Use of undefined constant Submit, assuming string 'Submit'.
> >>
> >> Since 'Submit' != "Remind Me", only the 'else' branch would ever

execute.
> >>

> >
> >The form that submits the data to this page has a value of "Remind Me" on
> >the submit button. I was trying to verify that the data I was dealing

with
> >was submitted from that form. If they clicked the submit button on the

first
> >page, this SHOULD be true -- it works with all my other sites.

>
> No, read it again. You've missed the $.
>
> >> > } else {
> >> > // pull listing from database
> >> > while($row = mysql_fetch_array($result)) {
> >>
> >> But $result was only defined inside the other branch of the if; surely

> >it's
> >> undefined here.

> >
> >True -- maybe I could copy the query down...? but that shouldn't be
> >necessary if the data is coming from the submitted form, right?

>
> Don't know, depends what you're passing.
>
> But it sounds like you need to put error_reporting to E_ALL as both of

these
> should have displayed visible warnings.
>
> --
> Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
> Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB 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
retrieving gps data from palmpilot Mike GPS 0 06-25-2007 11:44 PM
Please help - Cracking elevation data format in data file Kevin Fishburne Software Programming 10 06-12-2007 11:31 PM
cvs: pear /PEAR_Frontend_Web pearfrontendweb.php /PEAR_Frontend_Web/Frontend Web.php /PEAR_Frontend_Web/data style.css /PEAR_Frontend_Web/data/templates top.inc.tpl.html /PEAR_Frontend_Web/docs example.php index.php.txt Pear 0 05-27-2007 7:46 PM
cvs: pear /PEAR_Frontend_Web/Frontend/Web/data package.js style.css /PEAR_Frontend_Web/Frontend/Web/data/images category.jpg config.gif download.gif error.gif info.gif infoplus.gif install.gif install_fail.gif install_ok.gif install_wait.gif login.g Pear 0 05-20-2007 7:42 PM


Featured Websites




All times are GMT +1. The time now is 12:29 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98