mollemus Posted April 26, 2007 Share Posted April 26, 2007 Hello! Looked around the forum, but didn't really know what to search on, I need to have the effect you can do with html, <a href="index.html#text1"> but on a php-page. I have an index.php which generates a html-page with content from a database, and I want the user to be forwarded to the right section of this page. As it is now, i allready send two variables "index.php?lessonNr=1&chapterNr=1" but I also want to specify a section of the page. Tried "index.php?lessonNr=1&chapterNr=1#text1" but this obviously doesn't work. Can anyone help me? Thx Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/ Share on other sites More sharing options...
LazyJones Posted April 26, 2007 Share Posted April 26, 2007 There's no such things as "php-page". Only html pages parsed with php But, I'm pretty sure this would work: index.php#text1?lessonNr=1&chapterNr=1 Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/#findComment-238937 Share on other sites More sharing options...
mollemus Posted April 26, 2007 Author Share Posted April 26, 2007 Ok I will test that, thx. But even this forum seems to use that feature with the id of a reply which makes the page jump down to the reply with the id. Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/#findComment-238939 Share on other sites More sharing options...
taith Posted April 26, 2007 Share Posted April 26, 2007 index.php?lessonNr=1&chapterNr=1#text1 index.php#text1?lessonNr=1&chapterNr=1 both should work... are you sure you got the <a> named right? Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/#findComment-238940 Share on other sites More sharing options...
mollemus Posted April 26, 2007 Author Share Posted April 26, 2007 Hmm... this doesn't work for me, my index.php seems to get the variables for lessonNr and chapterNr confused with the #text1 that is sent to it. lessonNr and chapterNr ends up having no value, and the page becomes empty. I've written the index.php so that it writes out <a name="text1">, "text2" ... and so forth for each block of text it writes out. Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/#findComment-238944 Share on other sites More sharing options...
ToonMariner Posted April 26, 2007 Share Posted April 26, 2007 you don't need a named anchor anymore give each paragraph an id (and make sure each is unique and doesn't start with a number - i am using p1, p2 etc for this example); then any 'jump to' links in your page will only have to be <a href="#p7" title="Jump to paragraph 7">Paragrapgh 7</a> Link to comment https://forums.phpfreaks.com/topic/48754-jump-to-a-paragraph-on-a-php-page/#findComment-238961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.