Results 1 to 8 of 8

Thread: Count up script?

  1. #1
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Count up script?

    I'd like a count up script for php. I'm trying to get a microblog type page and I know little about php. Using the $_REQUEST or $_GET function is quite annoying, as the posts don't show up on the main page, and you could in essence "forge" a post. So I need a script that could count up and label the URL that way.

    .php?1 or .php?45 or Whatever it is.

    either that or a count up script that creates a file that can be displayed with a list that could get the variable, and then display the last 10 in a line.

    For example: Let's say we're at post 101. The next person comes along, and hits the submit button. Some script takes that person to a page called blog.php?102
    Then, they click a button below the post that takes them to the last ten, and it lists 102, 102-1, 102-2, so on and so forth on the same page using a file function for example.

    I already have the form code and posting $_REQUEST code. I just need a code that can simplify the url to numbers that count up every post.

    P.S.: The way I did it is the way I'm thinking is simplest based on my knowledge of php.

    P.P.S: kind of like for the topic/post name in the url. It says showthread.php?t=58704
    Last edited by atomic7732; 11-09-2010 at 03:36 AM. Reason: adding a bit more info

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Are you using a DB, if not how are these posts being stored?

    Using the $_REQUEST or $_GET function is quite annoying, as the posts don't show up on the main page, and you could in essence "forge" a post. So I need a script that could count up and label the URL that way.

    .php?1 or .php?45 or Whatever it is.
    I don't understand this part. The ? is producing a get request. You can build limitations into that get request. You should also be able to have them show up on the main page but that would require us seeing your code.
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I really don't know....

  4. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    microblogs are fun. I created one for my site and it is great for posting whatever whenever. The basic code is rather simple and from there you can tweak it and build upon it as much as you like.

    What you will need is php and MySQL. I am guessing you have some understanding of php and none with MySQL. MySQL can be seen as a glorified spreadsheet. I have not investigated it, but many people say http://www.php-mysql-tutorial.com is a great site for learning about mysql.

    First you will need to visit your hosting service and create a database. Depending on the hosting service you have there will be a certain number of databases you can create, but for most people one is more than enough. You will be asked to give your database a name and a password. A host name will be given to you. You will need to write these down for use later. You may need to wait a couple of hours for the database to be set up before you can use it, so you probably will not be able to use your database right away, but once it is set up the actual scripts involved are short and fairly simple.

    Let us know when you have the database set up and we can move on from there.

    I hate to add this part, but, yes, it is possible to create a microblog using just php, but is not as versatile and is (in my opinion at least, but I am sure others will back me up) needlessly more complicated.

    Not that it matters too much, but what hosting service do you use?
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'm following your micro-blog guide too James
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. #6
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    000webhost

  7. #7
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    cool cool. I am not all that familiar with them though, but it looks like they have what you need. Let me know when you have the database set up and then we can get started. Make sure you keep track of the database name, the password, and the localhost. Don't post it here in the forums though.
    To choose the lesser of two evils is still to choose evil. My personal site

  8. #8
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nevermind, I found it. It's creating it right now. It also says it will be created in 1 minute.

    Here is my code that I actually already had...

    Code:
    <html>
    <body>
    
    <?php echo $_POST["message"]; ?>!<br />
    <i>Posted by <?php echo $_POST["user"]; ?> on [day].</i>
    <hr />
    
    </body>
    </html>
    Last edited by atomic7732; 12-23-2010 at 02:12 AM. Reason: I found it

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •