Jump to content

Clarkie

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Clarkie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks that's exactly what I need! Thanks to you also I'll use this to actually get the right rows from the db.
  2. Hey, I'm using a script which allows you to click on a calendar to select the date to submit to the database. The date is submitted like this: 2014-02-08 Is there a really simple way to prevent rows showing if the date is in the past? Something like this: if($currentdate < 2014-02-08 || $currentdate == 2014-02-08) { } Thanks very much, Jack
  3. In the database I'll have 1 table setup like this: page id | object id | data 1 | 1 | heading name 1 | 2 | paragraph text Etc. Will take a look at how to use $_GET tomorrow. Thanks.
  4. Hey, I'm trying to work out how I can have a simple script that will work like this: Page 1 - Heading, Paragraph, Image read from database. Page 2 - Has text boxes allowing you to change heading, paragraph and image (url) with each edit using a different text box. (Admin panel) The database connection would be in a separate file. So far I've got the database connection sorted. <?php //Database Information $dbtype = "mysql"; $db_host = "localhost"; $db_user = ""; $db_pass = ""; $db_name = ""; $db_port = ""; $db_table_prefix = "userCake_"; ?> At the top of each of the other pages this is what I've got. <?php require_once("models/config.php"); ?> Let's say I give each bit stored in the database a page ID and an object ID. If the page selected is index.php how can we give it a page ID of 1 and give then include all the separate 'objects' throughout the page? Hopefully this makes sense? Cheers, Jack
  5. (Sorry for double post I can't edit atm) The other option is taking the working account.php and class.user.php pages and creating new pages that use the $_GET function (user.php?ID=?) in the same way I've tried to do.
  6. Hey, I've been using UserCake to create a game to help me teach myself PHP. This is the first time I've ever tried to use PHP and I'm struggling to add profiles to the script. The account page shows the logged in users amount of money etc and I took that and tried to edit it so it would use the $_GET function and then the url "user.php?ID=1" (example only) could be used to see user 1 and anyone could see the page. http://pastebin.com/u/Clarkie On Pastebin you can see the original files used for the account page starting with "UserCake". These pages work and do not need fixing. The pasties starting with "New UserCake" are my custom pages. I'd appreciate it if somebody could not only tell me how to fix it but also explain why it needed fixing so I can learn from the mistake. A live demo can be seen here: http://www.jacknathanclarke.info/dev/test/user.php?ID=1 Thanks for your time and help, Clarkie
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.