+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Help with PHP

  1. #1
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Help with PHP

    I'm learning php. I want to do a thing in php. Visitors to my site should be able to send their site to my site. Then the 10 most recent submitted link will show up under it. I thought of using php and mysql. I want to do that in the sql table there only will be 10 links and when it comes a new one the oldest will be deleten. Plz don't post any finished script since I want to learn on my own. I thought of using POST and GET functions (I've readed about them in a php book) but I'm not sure exactly how to use them and how to make it connect and submit it to an table in my database and make the last one disappear.

  2. #2
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Help with PHP

    Since you dont want finished scripts I'm just going to give you some practical tips.
    You want the database to store just 10 url's.
    Thats not too hard, just give the table a submition date and time field.
    Find the oldest and replace that record with the newly submitted url and the current date and time.

    As for the submition itself, you would indeed have to use POST or GET.
    Wich one you pick is upto you. (POST would be preferable for not showing in the url and allowing larger values)
    The way they both work is through a form.(wich is html)
    Once the form is submitted you can retrieve it in php with $_POST['name'] or $_GET['name'].
    Another thing of interest with it is the isset(); function.
    To make sure you wont get any anoying errors.



  3. #3
    nigel91's Avatar
    nigel91 is offline x10Hosting Member nigel91 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK, England
    Posts
    43

    Re: Help with PHP

    I would suggest looking to download something off the web, that is ready made.
    Click to visit nigel91.com
    Moving to x10Hosting soon, hopefully.

  4. #4
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Help with PHP

    Quote Originally Posted by nigel91 View Post
    I would suggest looking to download something off the web, that is ready made.
    As a mater of facts, I wouldn't for learning its best to just start and run into problems.
    In wich case google around for a solution and move on.



  5. #5
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Help with PHP

    I start with the sql... How many columns should it have?

    Edit: Eh just post an finished script then I maybe can study it and learn from it.
    Last edited by galaxyAbstractor; 10-28-2007 at 12:36 PM.

  6. #6
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Help with PHP

    The table could be like this:
    urlList(url,date,time)
    You could include descriptions and stuff like that but thats upto you.
    Also you should read up on how to handle sql queries in php.



  7. #7
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Help with PHP

    I get this error:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'date,time)' at line 1

    I wrote CREATE TABLE urllist (url,date,time)

    I tested this too:

    CREATE TABLE 'urllist' (
    'url',
    'date',
    'time'
    );

    But that didn't work either.
    Last edited by galaxyAbstractor; 10-28-2007 at 01:36 PM.

  8. #8
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Help with PHP

    No need to set it up with php, goto your cPannel, add a database and user.
    Link them.
    Go to phpMyAdmin and create the table from there.
    You can also execute queries there.

    The ony way you would need it is if you want to publish your code and create an install.php file.
    In wich case: http://www.1keydata.com/sql/sqlcreate.html
    There is the correct syntax.
    Last edited by Thewinator; 10-28-2007 at 01:42 PM.



  9. #9
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Help with PHP

    Ok I managed to add this:



    Can you please write the php script now. I will study it and maybe learn something

  10. #10
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Help with PHP

    If you want to just have the code done for you then I gues your just gonna have to post it in the marketplace.
    Or just pay me 200 credits right away and i'll do it for you.



+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  2. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  3. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  4. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers