Jump to content

Generating intro text based on user selection.


Lewisn

Recommended Posts

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:

 

selection.png

 

Now this is the part i would like to change based on their selection:

 

text.png

 

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:

 

code.png

 

Any help would be really appreciated!!

 

Thank you!

 

 

 

 

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

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

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

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.