Forum Thing in a different way? Like 'viewtoipic,php?'?
10-04-2009, 05:37 PM
|
Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 824
Name: Scott
Location: Ontario
|
Hey all,
On a lot of forums, there is a little code in the URL that says 'viewtopic.php?id=SERIALNUMBER'.
I need to do the same thing. I just don't know HOW.
I assume that all the posts are stored in a huge database, and when that special serial number in the URL calls for all posts with that serial number associated with that forum, it displays them in order (I don't care about order, JUST THAT THEY APPEAR AT ALL  )
So how would I do this with a flat file database? I can't figure it out.
My form contains a few fields, and once you click 'Add' it adds that information to a database. It also generates a random serial number and sticks it onto the content that the user wrote, in the same database. I need a little script that looks for that number in the database from the URL, pulls that and only that 'post', and displays it. For example;
A user types something into a form.
The content validates, allowing the user to continue
The user clicks 'Add', and their content is added to a flat file database named 'ffdatabase.txt'.
The script gives the user a URL, saying 'Here's your submitted content' along with a link that looks something like this:
Code:
http://www.example.com/viewusercontent.php?serialnumber=12345
And what that does is it opens that flat file database where their content is mixed in with all the other user's content, except his is the only one with the serial number '12345'. The script looks for the line (it's a big block of content, maybe a paragraph, so we use delimiters) that starts with '12345' and displays that line. So the page 'viewusercontent.php' now only contains 1 user's content, but with a simple change of the URL it shows somebody else's content.
Green text- Done
Red text = Not done yet
Thanks SO MUCH to whoever can do this!
Thanks,
Physicsguy
Last edited by Physicsguy; 10-04-2009 at 05:39 PM..
|
|
|
|
10-04-2009, 06:16 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 824
Name: Scott
Location: Ontario
|
What? That doesn't make any sense with this topic...
|
|
|
|
10-04-2009, 07:20 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 744
Name: Mattias Nordahl
Location: Sweden
|
Variables passed in the url can be accessed trough the superglobal $_GET array.
With the address your_page.php?var=value&var2=value2
You can access the variables with
PHP Code:
$var = $_GET['var']; $var2 = $_GET['var2'];
echo $var; // will print "value" echo $var2; // will print "value2"
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
|
|
|
|
10-05-2009, 04:36 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 824
Name: Scott
Location: Ontario
|
Yes, I know how to do that, I need a script that looks for that value in the database and displays it with the contents.
Thanks though!
I really don't want the whole URL to be something like this:
Code:
http://www.pgreviews.com/userreview.php?reviewtitle=iPod Touch&author=Physicsguy&content=
The Ipod Touch has everything you'd ever think of! You can check your e-mail, go on the internet with Safari, look up locations with Maps, and go on YouTube, with a free application specially made for it!
When you first get your Ipod Touch, it will ask you to download iTunes. iTunes lets you download songs for a small price straight from your Ipod to your Ipod! No computer needed!
When you go on Safari, the Ipod lets you zoom in on the page, so there's no need to worry about getting a magnifying glass out, although it comes with one of those! Simply pinch the screen in or out to zoom in or out! You can go pretty far in, too!
The Ipod Touch is also tilt-sensitive, so in some games you can tilt or turn the device to steer or walk/run! It's very fined-tuned, and it doesn't seem to go in stages (jittery, uncontrolled)!
On the back of the Ipod Touch, there is also a speaker so you can play your music with your friends without having to share headphones! It also shows the model (8GB, 16GB, or 32GB)
And if that's not enough, you can download more applications, or 'apps' to play with from the App Store, which comes free with the Ipod Touch. Lots of the apps on there are free, too! Some cost money, though, but again, you can download them anywhere!
Just like everything else, the graphics are amazing! It looks just like a TV screen! Plug the Ipod Touch into your computer (for large things like this, yes!) and pop it on simply by using iTunes! Not only can you get videos on there, but also podcasts! These you still have to plug in, since they are fairly large, but some are really great, like Will It Blend!&rating=10/10&ratingreason=For great apps, great graphics, great everything! The only thing is is that when you first get your Ipod Touch, you have to download iTunes and set up an account. You even have to put in your credit card number, or it won't let you continue! That's just so you can download apps that cost money without having to connect. The Ipod itself is also expensive, but believe me; it's definitely worth it!!
You see why. I want that all to be condensed into something like
Code:
http://www.pgreviews.com/userreview.php?reviewID=19264
Or I'd even settle for this:
Code:
http://www.pgreviews.com/userreview.php?reviewID=iPod Touch
I don't know how to make the script take that serial number out, like in YouTube, you know, something like http://www.youtube.com/watch?v=QjA5faZF1A8
Last edited by Physicsguy; 10-05-2009 at 04:46 PM..
|
|
|
|
10-06-2009, 05:03 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 824
Name: Scott
Location: Ontario
|
Sorry for the bump, I havne't found anything yet though. 
|
|
|
|
10-06-2009, 05:25 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 744
Name: Mattias Nordahl
Location: Sweden
|
I know we've said this before, but again, this all gets very complicated when you're using an ordinary .txt file for storing. In a MySQL database this would not just be easy, it would be the "normal" way of doing it. I can't help you much with the .txt file, perhaps somebody else can.
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
|
|
|
|
10-06-2009, 05:27 PM
|
Re: Forum Thing in a different way? Like 'viewtoipic,php?'?
|
Posts: 824
Name: Scott
Location: Ontario
|
Ahh, you're right. The problem is is that I was planning on releasing this to the world. Oh well  thanks!
|
|
|
|
|
« Reply to Forum Thing in a different way? Like 'viewtoipic,php?'?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|