|
Posted by Erwin Moller on 02/27/06 13:26
universalbitmapper wrote:
> Hi,
>
> This exercise (From PAM525Web Development) asks me to display a table
> of reviews, then sort the reviews depending on which column heading is
> clicked.
>
> I can't find how to write this line:
>
> <th><a
>
href=movie_details03.php?movie_id=$movie_id&coll_sort=\"review_date\">"Date
> of Review"</th>
>
> in this bit of code:
>
> $review_table_headings=<<<EOD
> <tr>
> <th><a
>
href=movie_details03.php?movie_id=$movie_id&coll_sort=\"review_date\">"Date
> of Review"</th>
> <th>Review Title</th>
> <th>Reviewer Name</th>
> <th>Movie Review Comments</th>
> <th>Ratings</th>
> </tr>
> EOD;
>
> The coll_sort variable is extracted by a GET
Hi,
You don't want " or ' in your url.
use urlencode to pass them around safely.
So try:
<?
$myUrl = "movie_detailso3.php";
// assuming $movie_id is a number, you do not need urlencoding
$myUrl .= "?movie_id=".$movie_id;
// assuming coll_sort need encoding:
$myUrl .= "&coll_sort=".urlencode("revie_date");
?>
<a href="<?= $myUrl ?>">sort on review date</a>
Now receive it like:
$sortorder = $_GET["coll_sort"];
Also note the & instead of &. It was not your problem, but the & is
better, according to W3C.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|