Lewisn Posted May 30, 2010 Share Posted May 30, 2010 Hi All, I recently took over SEO work for a client and as a favour he has asked me to make a couple changes to his site. The big one I'm stuck on is enabling PHP to generate a landing page between selection. Im going to list a few images to see if you guys can help, the website im talking about is http://www.weddingfares.co.uk So this is the section where the user selects the product they're looking for: Now this is the part i would like to change based on their selection: So I just need the selection to title the page.... for example: Balloons Please chose one one the counties on the right hand side And the other way around to: Avon Please select one of the categories from the left hand side I'm assuming i need to change something in the code around here: Any help would be really appreciated!! Thank you! Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/ Share on other sites More sharing options...
arbitter Posted May 30, 2010 Share Posted May 30, 2010 Can't you explode the link? say the link is: $url = "http://www.weddingfares.co.uk/index/na/Avon" $exploded = explode(" ", $url); //Then exploded[0] is the first part, exploded[1]the second, ... //so: $exploded[5] = 'Avon' (I'm not sure whether the // in http:// counts double or not, test it out. You can also work with $_GET[] superglobals. I don't know the method you're using now... If you use $_GET[] it's a lot easier. Though I'm sure there are dozens of possibilities here, and I'm not sure whether exploding is that safe; considering getting the url and stuff.. Hope this helps Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065288 Share on other sites More sharing options...
Lewisn Posted May 30, 2010 Author Share Posted May 30, 2010 Can't you explode the link? say the link is: $url = "http://www.weddingfares.co.uk/index/na/Avon" $exploded = explode(" ", $url); //Then exploded[0] is the first part, exploded[1]the second, ... //so: $exploded[5] = 'Avon' (I'm not sure whether the // in http:// counts double or not, test it out. You can also work with $_GET[] superglobals. I don't know the method you're using now... If you use $_GET[] it's a lot easier. Though I'm sure there are dozens of possibilities here, and I'm not sure whether exploding is that safe; considering getting the url and stuff.. Hope this helps Sorry! Im going to sound like a complete noob! I'm just really a beginner to PHP, Could I maybe upload a copy of my code and have you take a look at it? Like just when you get a minute. Let me know. Lewis Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065291 Share on other sites More sharing options...
xplosive Posted May 30, 2010 Share Posted May 30, 2010 Quick tip, isn't it Choose? Instead of 'Chose', just to fix your website's punctuation though Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065296 Share on other sites More sharing options...
Andy-H Posted May 30, 2010 Share Posted May 30, 2010 Quick tip, isn't it Choose? Instead of 'Chose', just to fix your website's punctuation though Please chose one one the counties on the right hand side. /// Please choose one of the counties on the right hand side. Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065298 Share on other sites More sharing options...
Lewisn Posted May 30, 2010 Author Share Posted May 30, 2010 Haha noted!! Now that we have corrected my poor use of the English Language lol :-p Any help on the matter in hand?? Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065300 Share on other sites More sharing options...
teamatomic Posted May 30, 2010 Share Posted May 30, 2010 Say you have a link for cakes. change it to use http://domian.com/cakes.php?landing=cakes then where the code you want to change is do this: $landing=$_GET['landing']; if($landing != '') { include("/path/to/landing/templates/$landing.php"); } else { include("/path/to/landing/templates/$default.php"); } [code] HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065320 Share on other sites More sharing options...
Lewisn Posted May 30, 2010 Author Share Posted May 30, 2010 Say you have a link for cakes. change it to use http://domian.com/cakes.php?landing=cakes then where the code you want to change is do this: $landing=$_GET['landing']; if($landing != '') { include("/path/to/landing/templates/$landing.php"); } else { include("/path/to/landing/templates/$default.php"); } [code] HTH Teamatomic The only problem with this method is as far as im away the sub pages are all database driven and thus derived from php written on the home page. . . . I basically need something that is going to include the link text rather than the URL I literally need it to have the link text on the first line and then to direct the user to the net step on another. I'm being a right pain I know... but I'll only learn by asking questions!! Thank you everyone for your help! Link to comment https://forums.phpfreaks.com/topic/203335-generating-intro-text-based-on-user-selection/#findComment-1065405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.