Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 10-19-2004, 03:32 PM   #1 (permalink)
Inactive
 
younghistorians's Avatar
 
Join Date: 10-13-03
Location: USA
Posts: 1,340
iTrader: 0 / 0%
Latest Blog:
None

younghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really nice
php query string displays text

Hi all,

I'm looking for a simple way to have text displayed based on a query string. For example, if someone visits index.php?name=tom, then a message defined by me will be displayed, like I LOVE YOU TOO MUCH! Somewhere I would be able to specify a name, and a message to be displayed with that (based on the name).



Would this be easier to hardcode into a single php script, or should I use a MYSQL database?



How would I do this?



Thanks!
younghistorians is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-19-2004, 03:46 PM   #2 (permalink)
Inactive
 
Rivux's Avatar
 
Join Date: 10-13-03
Location: Ontario, Canada
Posts: 783
iTrader: 0 / 0%
Latest Blog:
None

Rivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the roughRivux is a jewel in the rough
Send a message via ICQ to Rivux
This could be done with a database, flat files or even hardcoded into the php file. Depends on two things, how many of these name/message combos will you be creating and how often will you be updating them?
Rivux is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-19-2004, 04:24 PM   #3 (permalink)
Inactive
 
younghistorians's Avatar
 
Join Date: 10-13-03
Location: USA
Posts: 1,340
iTrader: 0 / 0%
Latest Blog:
None

younghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really nice
I'll be creating maybe 50-75 of these name/message combos. They will be updated about every 2 weeks. I don't mind a hardcoded script except for the fact that as of now I dont know how to write it.
younghistorians is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-19-2004, 05:20 PM   #4 (permalink)
Inactive
 
littleFella's Avatar
 
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
iTrader: 0 / 0%
Latest Blog:
None

littleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to behold
with 50 to 70 names I wouldn't bother with a database, a flat text file will do just fine
littleFella is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-19-2004, 05:33 PM   #5 (permalink)
Inactive
 
younghistorians's Avatar
 
Join Date: 10-13-03
Location: USA
Posts: 1,340
iTrader: 0 / 0%
Latest Blog:
None

younghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really nice
I've decided to just do it like this:

Code:
<?php if($HTTP_GET_VARS['bio'] == 'cow') { $name = "Brian"; $age = "old"; $message = "j00 r3@11y 1i/<3 h@10 2 @10+ @Nd +h@+ \/\/i11 b3 @ $\/\/33+ g@M3. h0\/\/3v3r, i h@v3 gM@i1. "; } elseif($HTTP_GET_VARS['bio'] == 'phil') { $name = "Phil"; $age = "35"; $quote = "What?"; } elseif($HTTP_GET_VARS['bio'] == 'tom') { $name = "Tom"; $age = "14"; $quote = "I like PHP"; } ?> <html> <body> Hi <?php echo "$name" ?>...<?php echo "$message" ?> </body> </html>
How can I define a message for a user not in the list of users? i.e. a random non-registered visitor not known/recognized by me? Kinda like a catchall?
younghistorians is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-19-2004, 06:57 PM   #6 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
if (!isset($bio)) {
$name = "anonymous";
$message="message";
}
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-20-2004, 03:50 PM   #7 (permalink)
Inactive
 
younghistorians's Avatar
 
Join Date: 10-13-03
Location: USA
Posts: 1,340
iTrader: 0 / 0%
Latest Blog:
None

younghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really nice
Great, thanks!

Is there any way I can add another fuction to this code to count (in a flat text file) the number of times the query has been accessed? In other words, a counter counting the number of times that bio has been viewed?
younghistorians is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-20-2004, 05:23 PM   #8 (permalink)
Inactive
 
younghistorians's Avatar
 
Join Date: 10-13-03
Location: USA
Posts: 1,340
iTrader: 0 / 0%
Latest Blog:
None

younghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really niceyounghistorians is just really nice
Never mind, ive figured out basically what i need to know.

thanks all!
younghistorians is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
All Query String PR is predicted? Johan007 Google Forum 8 10-12-2004 09:17 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 09:48 PM.
© Copyright 2008 V7 Inc