deansaddigh Posted March 1, 2010 Share Posted March 1, 2010 Im trying to pass course id to another page, but its not working and im getting lost in all the dots and " and ' echo '<a href="list_courses.php?id='.$row['course_id'].'"><p>'. $row['type']. ' :'.$row['course_name'].'</a></p><hr />'; Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/ Share on other sites More sharing options...
bullbreed Posted March 1, 2010 Share Posted March 1, 2010 do you get any error messages? Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1019997 Share on other sites More sharing options...
deansaddigh Posted March 1, 2010 Author Share Posted March 1, 2010 No but it doesnt do anything. its in a box that expands and i think that might be conflicting because when you click it, it closes the box Heres the page right at the bottom http://www.languageschoolsuk.com/school_details.php?id=83 Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1019998 Share on other sites More sharing options...
jl5501 Posted March 1, 2010 Share Posted March 1, 2010 The html is being produced invalidly, so this may help echo '<a href="list_courses.php?id='.$row['course_id'].'"><p>'. $row['type']. ' :'.$row['course_name'].'</p></a><hr />'; personally I prefer to use sprintf to build strings from pieces, or here use printf. I just find it easier to read printf("<a href=\"list_courses.php?id=%d\"><p>%s:%s</p></a><hr>",$row['course_id'],$row['type'],$row['course_name']); Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1020009 Share on other sites More sharing options...
deansaddigh Posted March 1, 2010 Author Share Posted March 1, 2010 I see thanks for your help. Unfortunately its still just closing the box even with your revisions, i believe its because its within <div id="caja">'; which is what i am using so the box expands to display all the courses related to that school and i beleive this bit of functionality, $("#mostrar").click(function(event) { event.preventDefault(); $("#caja").slideToggle(); }); $("#caja a").click(function(event) { event.preventDefault(); $("#caja").slideUp(); }); }); uses any link within the caja div make the box expand. Which is fine if i have normal text init but because im using a link it takes the expand function. Do you know a way i can get around this? I hope that made some sense Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1020015 Share on other sites More sharing options...
jl5501 Posted March 1, 2010 Share Posted March 1, 2010 Yes I see what you mean. If I were you I would assign an id to the X link and only let the jquery grab that id, then the others would be free to behave normally Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1020017 Share on other sites More sharing options...
deansaddigh Posted March 1, 2010 Author Share Posted March 1, 2010 Thanks for your advice, would it be possible to show me at all? As im not sure how i could do it? If thats ok i dont mean to be cheeky, im just very unsure Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1020019 Share on other sites More sharing options...
deansaddigh Posted March 1, 2010 Author Share Posted March 1, 2010 Its ok i have done it and what you said worked perfectly. Thanks very much for your help. Link to comment https://forums.phpfreaks.com/topic/193794-is-this-query-string-correct/#findComment-1020026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.