RE: Displaying Primary key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not going to go into all of the detail or question what you're doing
with the <script>, or ask about error checking.

 

Your problem is probably the mixed quotation mark use in the $_REQUEST
stuff.

 

I'm going to suggest a few things:

 

1. Use either $_GET or $_POST instead of $_REQUEST.

 

2. Pass a variable to that line with the requested value. So your new script
will look something like this:

$foo = $_POST['m_id'];

echo'<script> location = "upload_photos.php?m_id='.$foo.'"; </script>';

 

3. Try dropping the mixed use of quotations and escape the echoed quotes, if
only to help you debug the code. Single quotes are more efficient, but it
may be worthwhile to lose the headache. So the even *newer* code would look
like this:

$foo = $_POST["m_id"];

echo "<script> location = \"upload_photos.php?m_id=$foo\"; </script>";

 

--

Joe

 

From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of arvindsri123
Sent: Saturday, December 20, 2008 1:26 AM
To: php-objects@xxxxxxxxxxxxxxx
Subject:  Displaying Primary key

 

Hello All,

I am inserting data in a table, its working fine, there is primary
key "m_id".

after inserting data i m using redirect to go a another page, what i
want, when i am redirecting, i want url should be look like this (see
below)..but its not working...as I m not able to get "m_id" (A column
with primary key) value to pass it with url as i have shown.. 

echo'<script> location =
"upload_photos.php?m_id='.$_REQUEST['m_id'].'"; </script>';

Thanks,
Avi

 



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux