$_GET problem
Posted on
16th Feb 2014 07:03 pm by
admin
Hi all,
Have a bit of a problem with a little piece of code, I am not sure if this should be under php or ajax as I am not sure where the problem lies. Basically here is the script:
Did you know?Explore Trending and Topic pages for more stories like this.
Code: [Select]while($row = mysql_fetch_assoc($query))
{
echo "<center><tr><td style='color:#00F' align='center'>";
echo "<a href='./pages/stockpage.php?id=";
echo $row["stock_id"];
echo "' title='Contact Us' onclick='Modalbox.show(this.href, {title: this.title, width: 600}); return false;'>";
echo $row['stock_name'];
echo "</a></td><td align='center'>";
echo $row['t_val'];
echo "</td><td align='center'>";
echo $row['quant'];
echo "</td><td align='center' style='color:#00F'>";
echo $row['TotValue'];
echo "</td><td>buttonhere</td></tr>";
$TotValue += $row['TotValue'];
}
All this does is display info from the database, the problem I have is with the link. If I put my mouse over the link before clicking I get the correct url, ie http://localhost/stockluck/pages/stockpage.php?id=0.
The link is meant to open in a modalbox ajax popup, this is the code for stockpage is as follows:
Code: [Select]<?php
include('../common/dbconnect.php');
$stock_id = $_GET['stock_id'];
$query="SELECT * FROM stocks WHERE stock_id='$stock_id'"
or die(mysql_error());
while($row = mysql_fetch_assoc($query))
{
echo $row['stock_name'];
}
?>
However, the value for $stock_id is coming back as undefined. Any ideas what is causing this?
Thanks
No comments posted yet
Your Answer:
Login to answer
200
34
Other forums
A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:
"A WBS eleme
serializing objects - loses methods - the point being?
Hi
I know that serializing an object will lose the methods. But whats the point in that? What
Give me all your tricks for minimizing jar file size
Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier w
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
I was able to successfully create an Inbound delivery with reference to a PO
PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo
read integers that returns a negative or prints the average
Im trying to finish this homework assignment by tommarow afternoon and I keep getting stuck.
Wr
How to insert random unique values in 2 columns ?
I have table with 2 columns
Create Table code_for_code (
first_code varchar2(10) uni
Attempt to assign property of non-object in...
I'm having issues with the following function in PHP 5...
function getTreeWithChildre
Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat