Ask a Question related to PHP Development, Design and Development.
-
Wm #1
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> </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......);
}
Wm Guest
-
Problem retrieving data from SQL Server
I am a newbie to both SQL Server and webservices. I have mostly done programing in Foxpro, VB6, and a little C++, and VB.net. I have been able to... -
Retrieving Updated Data
Hi, I have a Windows application that consumes a web service. The data returned from this service contains product prices, ratings and other... -
retrieving data from website
hi there all, me again... is it possible if you know the layout of a web site, to retrieve data from it? i mean things like a weather site that... -
Forms and retrieving data
Hello, I'm a new user to DWMX and am quite the novice. My question is: How do you retrieve data / information from a form? I created a survey about... -
Problem Retrieving data from an SQL Query in ASP
You can create a table variable inside your code and insert the data from the cursor into it. Finally, return the table variable back to your ASP.... -
Andy Hassall #2
Re: PHP problem retrieving data
On Sun, 10 Aug 2003 18:19:38 GMT, "Wm" <LAshooter@hotmail.com> wrote:
If you'd had error_reporting turned up high enough, you'd have got a warning>I'm not sure why this isn't working, but it's giving me no output.
>
> if (Submit == "Remind Me") {
similar to:
Use of undefined constant Submit, assuming string 'Submit'.
Since 'Submit' != "Remind Me", only the 'else' branch would ever execute.
But $result was only defined inside the other branch of the if; surely it's> } else {
> // pull listing from database
> while($row = mysql_fetch_array($result)) {
undefined here.
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
Andy Hassall Guest
-
Wm #3
Re: PHP problem retrieving data
"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com...warning> 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 aThe form that submits the data to this page has a value of "Remind Me" on> similar to:
>
> Use of undefined constant Submit, assuming string 'Submit'.
>
> Since 'Submit' != "Remind Me", only the 'else' branch would ever execute.
>
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.
it's>> > } else {
> > // pull listing from database
> > while($row = mysql_fetch_array($result)) {
> But $result was only defined inside the other branch of the if; surelyTrue -- maybe I could copy the query down...? but that shouldn't be> undefined here.
>
necessary if the data is coming from the submitted form, right?
Wm
Wm Guest
-
Tom Thackrey #4
Re: PHP problem retrieving data
On 10-Aug-2003, "Wm" <LAshooter@hotmail.com> wrote:
Andy was trying to tell you that if (Submit should be if ($Submit> "Andy Hassall" <andy@andyh.co.uk> wrote in message
> news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com...> warning> > 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>> > 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.
--
Tom Thackrey
[url]www.creative-light.com[/url]
Tom Thackrey Guest
-
Andy Hassall #5
Re: PHP problem retrieving data
On Sun, 10 Aug 2003 18:31:26 GMT, "Wm" <LAshooter@hotmail.com> wrote:
No, read it again. You've missed the $.>"Andy Hassall" <andy@andyh.co.uk> wrote in message
>news:5n3djvgkucbpe3hmsdoh19n4eubi7guiii@4ax.com.. .>warning>> 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>>> 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.
Don't know, depends what you're passing.>it's>>>> > } else {
>> > // pull listing from database
>> > while($row = mysql_fetch_array($result)) {
>> But $result was only defined inside the other branch of the if; surely>>> 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?
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) ([url]http://www.andyh.co.uk[/url])
Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
Andy Hassall Guest
-
Wm #6
Re: 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...execute.> 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.. .> >warning> >> 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> >> similar to:
> >>
> >> Use of undefined constant Submit, assuming string 'Submit'.
> >>
> >> Since 'Submit' != "Remind Me", only the 'else' branch would everwith> >> >>
> >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 dealingfirst> >was submitted from that form. If they clicked the submit button on thethese>> >page, this SHOULD be true -- it works with all my other sites.
> No, read it again. You've missed the $.
>>> >it's> >> > } else {
> >> > // pull listing from database
> >> > while($row = mysql_fetch_array($result)) {
> >>
> >> But $result was only defined inside the other branch of the if; surely> >> >> 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> should have displayed visible warnings.
>
> --
> Andy Hassall (andy@andyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
> Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
Wm Guest



Reply With Quote

