$_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:
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
WM transfer order: confirm different batch than proposed by system
Hi folks,
following scenario: we have a full WM with mixed batch numbers allowed in stora
Greek characters in php
Hi,
I'm making a script and I m using for first time greek characters.
I started to write
Using the $_GET variable to view certain records
Hello,
First let me explain my problem, I have 2 pages the first page pull a list of Guide ti
XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h
Multiple forms on the same page (safari)
Hello everyone,
I have 3 forms on the same page, that opens in a new window and submits to a
How to ... (FAQs)
... get e-mail notifications
As several people asked how to get e-mail notifications when new posti
New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan
button help
i originally had this but realised it is much easier to have a button.
Code: <?php
help with multi-update
Now sure how to ask this really....
10g database if that matters.
I have a customer
Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi