473,699 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird query results / <title> issues

Hey everyone.

I'm editing some stuff I did last summer, trying to bugfix and improve
stuff. One improvement (or an oversight of the original design) is
adding dynamic <title> tags to my pages. Here's how I originally
structured my php pages:

include header.php (contents are basically my HTML/CSS up to the
<!--begin content--> point)
<php code>
include footer.php (contents are from <!--end content--> onwards).

Obviously this meant I had the same <title> as defined in header.php
for every page, not cool. I went through and revised the structure to
this:

include doctype.php (HTML from the opening document declaration down to
just before <title>)
Then began my query(s), and once the results were grabbed:
echo "<title>$bandNa me - recordName review</title";
include header.php (this file now contains everything below <title>
down to <!--begin content-->)
<php code to output content>
include footer.php (as above)

This worked great for almost all of my pages but one. Here's the link:

http://www.threechords.org/spb/reviews/678

This might look normal to you, but try clicking some of the other
reviews in the left panel. The cover image and headings stay the same,
and the author information at the bottom again stays the same, which is
of course incorrect. I'm not sure where I'm going wrong with my code,
so I'll post up what I'm doing:

http://www.threechords.org/spb/revie...layreview.phps

That file has doctype.php, header.php and footer.php physically
included so you can see their contents too (ordinarily they're included
with php includes).

Any advice as to why I can't get this to work/ how terrible my code
structuring is would be really helpful.

Matt

Feb 18 '06
13 1643
joe
> $author = mysql_query("SE LECT Staff_id, displayname, email FROM users WHERE Staff_id='$Revi ewer_Name'");

Is Staff_id an integer and Reviewer_Name something else, e.g. varchar?
Seems like you would want to compare displayname with Reviewer_Name (I
could be wrong here obviously).

One thing that's odd is that the tite is correctly holding the
Record_Name value, but later in the script it gets lost somehow....

Feb 24 '06 #11
joe
Do those other includes (latestreviews. php, latestreviews2. php) have
variables with the same name as those in displayreview.p hp (like
$Band_Name, Cover_Image)?

This may be stating the obvious but from what I could tell, the
variables getting lost/displaying incorrect info are Band_Name,
Record_Name, Cover_Image, and displayname. The rest seem to be coming
through ok, since the text of the review changes appropriately, as does
the score, the link to the band's site, etc.

Feb 24 '06 #12

joe wrote:
$author = mysql_query("SE LECT Staff_id, displayname, email FROM users WHERE Staff_id='$Revi ewer_Name'");
Is Staff_id an integer and Reviewer_Name something else, e.g. varchar?
Seems like you would want to compare displayname with Reviewer_Name (I
could be wrong here obviously).

One thing that's odd is that the tite is correctly holding the
Record_Name value, but later in the script it gets lost somehow....


Despite the names, Reviewer_Name is an integer as well. I changed the
db structure around and was too lazy to change it to something more
meaningful (and thus all the references to it elsewhere).. I suck,
haha.

Yeah, see what I mean? It's a weird error.
joe wrote: Do those other includes (latestreviews. php, latestreviews2. php) have
variables with the same name as those in displayreview.p hp (like
$Band_Name, Cover_Image)?


Yeah they do, I'll try removing the includes for those files and see
what happens.

Feb 25 '06 #13
gu************@ gmail.com wrote:
Jerry Stuckle wrote:

Again, what is there?

Also, please quote what you're replying to. Not everyone has access to
previous messages.

Apologies for that.

Well, we can compare the dev site with the live one:

Live: http://www.scenepointblank.com/reviews/679

Dev: http://www.threechords.org/spb/reviews/679

Try changing the numbers in the URLs: the image, band name, record and
review name are all messed up. Both sites use the same database (the
dev site is a duplicate of the live one).


Again - are you sure you don't have a corrupted database?

Did you try echoing the values you retrieved from the database like I
suggested?

Sometimes an echo here and there does wonders for debugging!
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Feb 25 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4140
by: Info 3000 | last post by:
Hi there, Simple question, but headache ! I have a PHP Page like : <HTML> <HEAD> <TITLE>Sunny day !</TITLE> </HEAD>
3
10105
by: D. Alvarado | last post by:
Hello, I am trying to find the <TITLE> element of my document. Normally alert(document.title); works just fine, but when this statement is within a page that is a frame in a larger document, the above call always returns the title of the parent (container) page. Is it possible through JS to deduce the <TITLE> element of the current page, even if that page is a frame?
1
1398
by: Andreas Klemt | last post by:
Hello, I have in my strHtml a html page. so what is the fastest way (with XML Read?) to get the "myValue" between <title>myValue</title> Thanks, Andreas
6
1937
by: Alex | last post by:
Hi, is it possible to set the title programatically from the code behind page. I placed a literal in the head section of the form and set its text property. it seemed to work bu the literal is not in the <form> section of the page. does this matter or is there a better way to programatically/dynamically set the title of the page.
8
3964
by: DC | last post by:
In HTML page, I put: <html> <head> <title>Article: <asp:Label ID="lblHTMLTitle"></asp:Label> </title> .... In the code behind: ....
7
1587
by: Brad | last post by:
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%. Brad
1
1869
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The master page looks like this... <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
4
3829
by: David Thielen | last post by:
Hi; If I am using master pages, how do I set the <title> and <meta name='description' content='my title'> for each page. Obviously each page will have a different title & description. -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
5
1246
by: dbuchanan | last post by:
How can a page title be supplied at runtime. It looks to me like it is hard coded, but there must be some way. <head runat="server"> <title>Training</title>
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.