473,748 Members | 2,398 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 1649
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
4142
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
10107
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
1401
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
1941
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
3970
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
1588
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
1872
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
3830
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
1248
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
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
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...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
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...
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.