Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
help needed with dynamic title
Old 03-16-2009, 08:01 AM help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
my url is: http://bathtab.co.uk/
at the moment, the search results title tag is always: The UK Property Search Engine
what i want is to make it dynamic, so when you search for london, it'll display in the title the place as well as property type and either rent/buy.
thanks!
some source code:

<form action="http://bathtab.co.uk/search.php" method="get">
<table align="center" cellspacing="0" style="font-family:arial; border:0px solid #888; padding:3px">
<tr>
<td><select name="listing_type">
<option value="buy" selected>For Sale</option>
<option value="rent">To Rent</option>
</select></td>
<td><input name="place_name" value="" size="25"></td>

<td><select name="property_type">
<option value="all">House or Flat</option>
<option value="flat">Flat</option>
<option value="house">House</option>
</select></td>
<td><input type="submit" value="Search"></td>

</tr>
<tr>
<td> </td>
<td colspan="2" align='left' style='font-size:10px; color:#888'>Location e.g. Bath</td>
</tr>
</table>
</form>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
luckyman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-16-2009, 08:30 AM Re: help needed with dynamic title
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nothing in the code you have posted will help.

Capture the search terms server side, which you MUST do to search with, and write them into the title element
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2009, 08:35 AM Re: help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
results are displayed in a frame, we do not use a database but pull results:

HTML Code:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<script type="text/javascript">
  function bounce(){
      parent.nestframe.window.location.href 
          = "http://cb.nestoria.co.uk/cgi/search" 
          + window.location.search;
      return 1;
  }
</script>
</head>
<frameset rows="124,*" onload='javascript:bounce();'>
<frame noresize="noresize" frameborder="0" src="header.php">
<frame noresize="noresize" frameborder="0" src="footer.php" name='nestframe'>
</frameset>

i've tried <?php echo ucwords(str_replace(array('<','>'), '', urldecode($_GET['place_name']))); ?> but it doesn't work
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by chrishirst; 03-16-2009 at 09:06 AM..
luckyman is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 09:11 AM Re: help needed with dynamic title
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You will have to use javascript.

Code:
parent.document.getElelementsByTagName("title").innerHTML = "Text to put in title";
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2009, 09:44 AM Re: help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
thanks, that works great for the title tag, but not when i implemnt the code in the content. please assist.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
luckyman is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 10:43 AM Re: help needed with dynamic title
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
frameName.document.getElementById("contentholder").innerHTML = "Whatever you want it to say";
replace "frameName" and "contentholder" with appropriate element names
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2009, 11:23 AM Re: help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
i can't get it to work. what will i need to use to call the details from the javascript
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
luckyman is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 01:13 PM Re: help needed with dynamic title
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
absolutely no idea.

We have no idea how you collect the search details or how you send them to the remote site.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2009, 01:21 PM Re: help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
i followed the instructions here: http://www.nestoria.co.uk/help/cobrand-howto
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
luckyman is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 04:28 PM Re: help needed with dynamic title
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
So despite this being the PHP forum there is no PHP used at all.

To be brutally honest (not that I am ever anything else) I would suggest that implementing a querystring parser in javascript would be somewhat beyond your experience, unless of course you know how to prototype new objects and methods in js.

So we are back to post no 2 and you code some PHP $_GET statement to retrieve the key/value pairs and display them in the frameset page and in the header page.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-16-2009, 04:34 PM Re: help needed with dynamic title
luckyman's Avatar
Skilled Talker

Posts: 69
Trades: 0
ok thanks, i'll make a post over at coding instead. cheers.
please lock and remove this thread.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
luckyman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to help needed with dynamic title
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34932 seconds with 12 queries