Saturday, 15 June 2013

Passing a PHP Variable by URL Link in Wordpress -



Passing a PHP Variable by URL Link in Wordpress -

i trying pass variable mysql query page way of user clicking on link.

my query lists out in table number of reports. want user able click on study number in table send user page in plan run query based on study number variable sent in link.

here code prints out table rows:

while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['report_number'] . "</td>"; echo "<td class='tableleft'>" . $row['inspector'] . "</td>"; echo "<td class='tableleft'>" . $row['idate'] . "</td>"; echo "<td class='tableleft'>" . $row['vendor'] . "</td>"; echo "</tr>"; }

row 1 string $row['report_number'] variable want pass page way of link.

the problem having beingness executed on wordpress page page have link to, page in wordpress, not have .php page type.

i can not figure out how write link pass variable without .php in example:

<a href="edit_form.php?id=<?php echo $row['id']; ?>">edit</a>

you don't need .php in link. can utilize link example: http://site.com/page?id=2&something=10. so, clear, after link page want link to, type "?" , attach variables.

one more thing. have careful , post variable names in wordpress, because of them restricted , may truncated request.

hope helps.

php wordpress variables

No comments:

Post a Comment