code doesn't process

This is a discussion on code doesn't process within the alt.comp.lang.php forums, part of the PHP Programming Forums category; same problem before but this time I am putting in alerts, echos, and exit() When I hit the submit button ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-17-2007
Kevin Raleigh
 
Posts: n/a
Default code doesn't process

same problem before but this time I am putting in alerts, echos, and exit()
When I hit the submit button the page reloads and comes up as a blank page,
no content.

Have I called the form correctly?


None of it is being processed. How is that possible? I have put in echo
statements and exits
statements but nothing...


The form:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<div align="center"><input type="submit" name="Submit" value="Add
New User" /></div>
</form>

the code:
<?php
if (isset($_POST['Submit'])) {
$userID = (int)$_GET['id'];// if you don't use quotes in your sql you must
cast the input
$secureID = (int)$_GET['code'];

if (!get_magic_quotes_gpc()) {
$userID = addslashes($_GET['id']);
}

$check = mysql_query("SELECT * FROM user WHERE id = $userID")or
die(mysql_error());


//Gives error if user dosen't exist
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
die(mysql_error());
}

while($info = mysql_fetch_array( $check )){
$dbSecureID = stripslashes($info[secureID]);
$fName = stripslashes($info['fName']);
$lName = stripslashes($info['lName']);
//gives error if the password is wrong
}

// check out this code!

$userName='';
if(!$userName = "$fName $lName"){
die("no value");
}else{
echo "hello world";
exit();
}
// it never processes, what gives??
// then my email form is never sent
// is there something wrong with the form submittion?



if ($secureID != $dbSecureID) {
die('This user has not registered yet!');
} else{
mysql_query("UPDATE user SET confirmIDFlag=1 WHERE id=$userID")or
die(mysql_error());


require("php/class.phpmailer.php");
$mail = new PHPMailer();
// set mailer to use SMTP
$mail->Host = "relay-hosting.secureserver.net";

$mail->From = "sermon8or@1purpose-bethel.org";
$mail->FromName = "Pastor Art Gorman";
$mail->AddAddress("kraleigh@sbcglobal.net", "$userName");
$mail->WordWrap = 50;
$mail->IsHTML(true);

// set email format to HTML

$mail->Subject = "Welcome $userName";
$mail->Body = "This email is to inform $userName<br/> that
you have been added to our mailing list";
$mail->AltBody = "This email is to inform $userName<br/> that
you have been added to our mailing list";

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
}
?>
<html><body><h1>Hello world</h1></body></html>
<?php
}else{

my html forms page...
<?php
}
?>

insight always appreciated
thank you
Kevin Raleigh












Reply With Quote
  #2 (permalink)  
Old 07-18-2007
Kevin Raleigh
 
Posts: n/a
Default Re: code doesn't process


"Kevin Raleigh" <kraleigh@sbcglobal.net> wrote in message
news:8ICdneW5pJsQhwDbnZ2dnUVZ_veinZ2d@giganews.com ...
> same problem before but this time I am putting in alerts, echos, and

exit()
> When I hit the submit button the page reloads and comes up as a blank

page,
> no content.
>
> Have I called the form correctly?
>
>
> None of it is being processed. How is that possible? I have put in echo
> statements and exits
> statements but nothing...
>
>
> The form:
> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
> <div align="center"><input type="submit" name="Submit" value="Add
> New User" /></div>
> </form>
>
> the code:
> <?php
> if (isset($_POST['Submit'])) {
> $userID = (int)$_GET['id'];// if you don't use quotes in your sql you

must
> cast the input
> $secureID = (int)$_GET['code'];
>
> if (!get_magic_quotes_gpc()) {
> $userID = addslashes($_GET['id']);
> }
>
> $check = mysql_query("SELECT * FROM user WHERE id = $userID")or
> die(mysql_error());
>
>
> //Gives error if user dosen't exist
> $check2 = mysql_num_rows($check);
> if ($check2 == 0) {
> die(mysql_error());
> }
>
> while($info = mysql_fetch_array( $check )){
> $dbSecureID = stripslashes($info[secureID]);
> $fName = stripslashes($info['fName']);
> $lName = stripslashes($info['lName']);
> //gives error if the password is wrong
> }
>
> // check out this code!
>
> $userName='';
> if(!$userName = "$fName $lName"){
> die("no value");
> }else{
> echo "hello world";
> exit();
> }
> // it never processes, what gives??
> // then my email form is never sent
> // is there something wrong with the form submittion?
>
>
>
> if ($secureID != $dbSecureID) {
> die('This user has not registered yet!');
> } else{
> mysql_query("UPDATE user SET confirmIDFlag=1 WHERE

id=$userID")or
> die(mysql_error());
>
>
> require("php/class.phpmailer.php");
> $mail = new PHPMailer();
> // set mailer to use SMTP
> $mail->Host = "relay-hosting.secureserver.net";
>
> $mail->From = "sermon8or@1purpose-bethel.org";
> $mail->FromName = "Pastor Art Gorman";
> $mail->AddAddress("kraleigh@sbcglobal.net", "$userName");
> $mail->WordWrap = 50;
> $mail->IsHTML(true);
>
> // set email format to HTML
>
> $mail->Subject = "Welcome $userName";
> $mail->Body = "This email is to inform $userName<br/> that
> you have been added to our mailing list";
> $mail->AltBody = "This email is to inform $userName<br/> that
> you have been added to our mailing list";
>
> if(!$mail->Send())
> {
> echo "Message could not be sent. <p>";
> echo "Mailer Error: " . $mail->ErrorInfo;
> exit;
> }
> }
> ?>
> <html><body><h1>Hello world</h1></body></html>
> <?php
> }else{
>
> my html forms page...
> <?php
> }
> ?>
>
> insight always appreciated
> thank you
> Kevin Raleigh
>

Problem resolved

Thank you
Kevin Raleigh


Reply With Quote
Reply


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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0