$_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
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al
Form Help
Here is the form:
Line number On/Off | Expand/Contract<? include("../include/sess
PHP not creating file.
Its supposed to create a .ini file in the /scriptfiles/users/ with the name they entered into the fi
pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that
PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP
and for school we have to make a PHP script which reffers to a Data
rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam
Convert Binary String to Decimal
Trying to Get:
Decimal: 305419896
Out of:
Binary String: xV4
PHP url branch??
Functionally, using PHP, I'm doing a test of login input submitted by a user via an html form in a f
recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can
array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h