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!!! with PHP/MySQL and title tags....
Old 01-13-2010, 02:34 PM Help!!! with PHP/MySQL and title tags....
Novice Talker

Posts: 9
Trades: 0
I am working on a real estate property website. On the properties page PHP calls to the database to retrieve the list of properties to display. It calls to the table and displays them but with a default page title listed in frames.php...HOW can I have each property name listed in the title tag if it is selected from the list? I am so lost, so please bare with me...ask questions because I have no idea what I'm doing...

Thanks, here is what I think is the most important snippet of code from properties.php file...


PHP Code:
<?php

session_start
();
include (
"frames.php");

$pg='properties';

/************************ Get the property name *******************/
if (isset($_GET['p']))
    
$p preg_replace('/[^0-9a-zA-Z]/'''$_GET['p']);
else
    
$p '';

/********************* Get its id from the property table *****************/
$db=mysql_connect ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
if(!
$db) die("Could not connect to MySQL");
mysql_select_db("XXXXXXXX",$db) or die ("could not open db".mysql_error());
$query "select * from prop";
$result mysql_query($query);
$res_array = array();
for (
$count=0$row mysql_fetch_assoc($result); $count++)
$res_array[$count] = $row;
foreach (
$res_array as $row) {
    
$tmp preg_replace('/[^0-9a-zA-Z]/'''$row['title']);
    if (
$tmp == $p) {
        
$id $row['id'];
        break;
    }
}

if (isset(
$_GET['m']))
    
$p preg_replace('/[^0-9a-zA-Z]/'''$_GET['m']);
else
    
$p '';
if (
$p == 'map' || $id == 0)
    
head($pg$id);
else
    
head('notprop'$id);

    
/***************** LEFT COLUMN MENU AND BUTTONS *************************/
    
echo '<div class="leftcolumn">';

        echo 
'<a href="'.PATH.'properties"><img src="'.PATH.'images/our_properties.gif"></a>';
        echo 
'<img src="'.PATH.'images/view_all_for_properties.gif" style="margin: 10px 0 0 0;">';

        
/**    Find out if this is a commercial property. Customize        **/
        /**    application form if we're showing an individual property    **/
        /**    that's also not commercial                                    **/
        
$result query_database("select * from prop, areas where prop.area = areas.id and prop.id = '$id'");
        
$commercialFlag $result[0]['commercial'];
        if (
$commercialFlag == "" && $id != 0) {
            echo 
'<form action="'.PATH.'apply" method="post">';
            echo 
'<input type="hidden" name="sendemail" value="1" style="display: none;">';
            echo 
'<input type="hidden" name="id" value="'.$id.'" style="display: none;">';
            echo 
'<input type="image" src="'.PATH.'images/apply_online_for_properties.gif" style="width: 296px; height: 34px; margin: 10px 4px 0 0;">';
            echo 
'</form>';
        }
        else {
            echo 
'<a href="'.PATH.'apply"><img src="'.PATH.'images/apply_online_for_properties.gif" style="margin: 10px 0 0 0;"></a>';
        }

        echo 
'<img src="'.PATH.'images/our_property.gif" style="margin: 10px 0 10px -1px; width: 297px;">';

        
/*****    Display left side menu        ******/
        
$result query_database("select * from areas order by displayorder");
        
/*****    First show the area            ******/
        
foreach ($result as $row) {
            echo 
'<div class="menuitem" style="font-weight: bold;">';
                echo 
$row['title'];
            echo 
'</div>';
            
$areaID $row['id'];
            
$result query_database("select * from prop where area = $areaID  order by displayorder");
            
/*****    Now show the property    ******/
            
foreach ($result as $row) {
                
$pgurl str_replace(' ''',preg_replace('/[^a-zA-Z0-9\s]/'''$row['title']));
                if (
$row['id'] == $id) {
                    echo 
'<div class="menuitem" style="color: #8E8A6D; margin: 0; font-size: 12px; width: 275px; float: right; background-color: #E6F5A9">';
                }
                else {
                    echo 
'<div class="menuitem" style="color: #8E8A6D; margin: 0; font-size: 12px; width: 275px; float: right;">';
                }
                    echo 
'<a href="'.PATH.$pgurl.'">››  '.$row['title'].'</a>';
                echo 
'</div>';
            }
            echo 
'<div class="divider">&nbsp;</div>';
        }
        
        

    </
div> <?php

Last edited by chrishirst; 01-13-2010 at 02:57 PM..
thegrandwazoo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-18-2010, 02:59 PM Re: Help!!! with PHP/MySQL and title tags....
Novice Talker

Posts: 9
Name: Wayne
Trades: 0
I think you'll have to explain your question a little better. Your question may make sense to you, but not to others. What exactly are you trying to do?
__________________

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
waynewex is offline
Reply With Quote
View Public Profile Visit waynewex's homepage!
 
Old 01-18-2010, 07:00 PM Re: Help!!! with PHP/MySQL and title tags....
Junior Talker

Posts: 4
Name: Nilber
Trades: 0
first you need to see in your database where are the information you want as the title, and then make a query in these Table.
nb-master is offline
Reply With Quote
View Public Profile Visit nb-master's homepage!
 
Reply     « Reply to Help!!! with PHP/MySQL and title tags....
 

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.28237 seconds with 12 queries