Jump to content
Larry Ullman's Book Forums

Trevor

Members
  • Posts

    4
  • Joined

  • Last visited

Trevor's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi again HartleySan I have carefully considered your advice as I felt the answer was in there somewhere. You were right. My main urls were all OK but an internal link in the program had a space in the name. I have removed this and the whole thing works perfectly. Many, many, many thanks Trevor
  2. Hi again HartleySan Also made the url a simple short name "sound". Still didnt work Trevor
  3. Hi HartleySan Many thanks for your advice The url is generated by the script in a function called absolute url and it appears in the IE7 address bar perfectly. Tried changing all the urls to ones without spaces (ansd all in lowercase) as that seemed a good idea It did not work I have previously tried running sections of the code on their own, such as: CODE SECTION 1: <tr> <td align="left"><b>Edit</b></td> <td align="left"><b>Delete</b></td> <td align="left"><b><a href="view_users.php?sort=ln">Last Name</a></b></td> <td align="left"><b><a href="view_users.php?sort=fn">First Name</a></b></td> <td align="left"><b><a href="view_users.php?sort=rd">Date Registered</a></b></td> </tr> Which is the code to generate the ?sort and it works perfectly CODE SECTION 2: $sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'rd'; switch ($sort) { case 'ln': $order_by = 'last_name ASC'; break; case 'fn': $order_by = 'first_name ASC'; break; case 'rd': $order_by = 'registration_date ASC'; break; default: $order_by = 'registration_date ASC'; $sort = 'rd'; break; } which is the section to rearrange the sort works if i try to echo $order_by just to test it. But when they are combined with the section $q = "SELECT last_name, first_name, DATE_FORMAT(registration_date, '%M %d, %Y') AS dr, user_id FROM users ORDER BY $order_by LIMIT $start, $display"; $r = @mysqli_query ($dbc, $q); Which should make the lists reorder It stops working and the program stops recognising the url appendage (?sort=) Trevor
  4. Chapter 9 of the book uses the ? in the url to change the data sort order and to move to extra data if the number exceeds the allowed list. I cannot get it to work; please help The script (Script 9.5 #5)creates a new url such as "http://localhost/Trial%20System%20for%20Graham/admin/view_users.php?sort=fn" but IE7 simply says it cannot find the page. I have tried to separate the parts of the script and test them separately and they all seem to work. That is I can artificially create a url with ? in it, recover it and use echo to show that it has been recovered and understood. But for some reason I am totally stumped by why the complete script wont work By the way it I cannot get it to work either on sorting the columns (url = "http://localhost/Trial%20System%20for%20Graham/admin/view_users.php?sort=fn" ) or on move to next page (url = "http://localhost/Trial%20System%20for%20Graham/admin/view_users.php?s=10&p=2&sort=rd") Plase help before I loose all my hair Trevor
×
×
  • Create New...