Well for one....

> echo "\t <input type='hidden' name='first'
> value='".stripslashes($first)."'>\n";
> echo "\t <input type='hidden' name='first'
> value='".stripslashes($last)."'>\n";

Both of these fields are called 'first' instead of 'first' and 'last' so the
last name is actually overwriting your first name.
Secondly, you are not using proper php variables into
delete_entry_confirm.php.  I'm guessing that this is an .html file because I
don't see an 'echo' statement in front, so the only way to send the
variables without using php code is to populate data in a form using hidden
input fields and a submit button called delete, or to use php and send the
variables like this:

echo '<a href="delete_entry_confirm.php?first=' . $yourfirstname . '&last='
. $yourlastname . '">DELETE</a>';

Good luck.
Dean Householder
http://www.daylightcreations.com


"pjc" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I just started playing with PHP and MySQL and am building an online
> phonebook for myself.
>
> From my 'view_all_numbers.php' I have a link that looks something like
this:
>     <a
>
href="delete_entry_confirm.php?first=yourfirstname&last=yourlastname">DELETE
> </a>
>
> Here is the code from delete_entry_confirm.php
> <?
> echo "<h3 align=center>Are you sure you want to delete <br>";
> echo "<i>".$first." ".$last."</i>";
> echo "<br>from the phonebook?</h3>\n\n";
> echo "<form action='delete_entry.php' action='get'>\n";
> echo "\t <input type='hidden' name='first'
> value='".stripslashes($first)."'>\n";
> echo "\t <input type='hidden' name='first'
> value='".stripslashes($last)."'>\n";
> echo "<input type=submit value='Delete This Entry'>";
> echo " <input type=button value='I would rather keep it...'
> onclick='javascript:history.back();'>";
> echo "</form>";
> ?>
> =======================================================
> And here's the code from my delete_entry.php
> <?
> if(!$last || !$first) {
>  echo "<h4 align=center>Something's fucked up with yo script ya
> herd...</h4>";
>  exit;
> }
>
> $db = @mysql_connect("localhost","login","pass");
>
> if (!$db)
>  {
>  echo "<b>Database ain't workin dawg!!</b>";
>  exit;
>  }
>
> mysql_select_db("paultest");
> $query = "delete from phonebook where last='".$last."' and
> first='".$first."'";
> $result = mysql_query($query);
> if($result)
>  echo "<h3>".mysql_affected_rows()." record(s) deleted.</h3>";
> ?>
> =======================================================
>
> This link does work though: <a
> href="delete_entry.php?first=yourfirstname&last=yourlastname">YES I WANT
TO
> DELETE</a>
>
> The error that I am getting on delete_entry.php is that my variables
aren't
> there. Any suggestions folks?
>
> Thank you in advance.
> -p
>
> --
>
> Paul C
> [EMAIL PROTECTED]
> ICQ:68274240
>
> "You can't put a bag over someone's personality."
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to