-
PHP Title Script
Oookay. So I've been trying forever to make the title do what I want, and it seems like it should be simple! But I can't get it to work. @_@ So help. I promise I won't figure this out in 15 minutes and say "Never mind." xD
I stripped the page down to the basics. This is my script:
100 x 100 Avatars
This is the script in action:
100 x 100 Avatars
<b>Explanation</b>: What it does is basically pulls from each directory any avatars I upload and displays them on the site. There's the $catname variable which shows the name of the folder the avatars are in minus any underscores.
What I want is to also display the $catname in the title, but it doesn't work because I think it hasn't been declared and I tried a bunch of crap, and I'm confused? xD
For example, if you click the "Asian Girls" category, it takes you to the page. I can get the words "Asian Girls" to display on the page via $catname, and Asian_Girls is the name of the folder all of those avatars are in.
The title to all the pages right now is "100 x 100 Avatars." How would I get it to display "100 x 100 Asian Girls Avatars" instead, and modify for all of the other categories as well? :3
Um so if someone has a lot of time... xD Thanks~!
-
-
Oh oops, I have a /head tag in the original. xD I just stripped everything down so it's pretty much the code.
And I still can't get it to work, I dunnno @_@ I've tried like everything already. I updated the code and the script at work in the first post, if you click them. Now it just completely messes up xD
Could you or anyone by any chance write out how to put it in the title for me? ;3
-
Hypnotising you
Contributions
- Former Administrator
- Former Cid's Knight
-
It should be the same. xD I'm sure the coding isn't in correct form or whatever, but the point is that it works and I don't really care beyond that (Well not anymore that I messed it up by putting a bunch of PHP in the beginning but I can put it back later xD)
I just wanna know how to do the title thing ;_;
-
Aren't you already halfway there? When I click on any of those categories I see the name being displayed at the top. If you just put it inside the <title>-tag you should be all set.
In code.txt, line 115 change "h1" to "title" and the category is displayed as title. Unless I misunderstood that is what you wanted, isn't it?
-
Kinda, but oi you know what, you're right.
I could have avoided ALL this pain by just putting the title at the end of the page.
I've just... grown up learning that the title has to be in the <head> section ;__; But it still displays if I put in or after the body. xD
-
Actually the title should still be inside the head-section. But it still is, if you follow my steps. In that line, the head-tag is still open, you would have to close it some lines later and open a body tag.
-
Ominous Wanderer
Tech Admin
Just a side note:
htmlspecialchars() is your friend. You might want to escape/sanitize your input ($_GET and such).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules