Jump to content

teki

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

teki's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey GUys i need a bit of help. I need to use a code to make a cookie remember this. There are 2 forms 1 is the style and 1 is the option of floating images First One SKINS Default 1 index.php Default 2 indexshadow.php SECOND FLOATING Floating off (depending on theme) indexshadow.php or index.php Floating cricket (Depending on theme) indexshadowcricketballs.php and indexcricketballs.php Floating NRL (Depending on theme) indexshadownrlballs.php and indexnrlballs.php
  2. [!--quoteo(post=372521:date=May 9 2006, 04:56 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 9 2006, 04:56 PM) [snapback]372521[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yes, you need to connect on each page that accesses the db [/quote] also barand do i need to use the code emehrkay gave me? The one that goes $id = $_GET['id']; //get the id from the querystring $query = "SELECT * FROM table WHERE id = ". $id .""; Also would the code for showing latest article be [code]$x = 1; $sql = "SELECT id, title FROM articles ORDER BY id DESC LIMIT $x";[/code] and if you had five variables in the article and you only wanted to show 2 of them with that latest one article code what would you add to that code?
  3. [!--quoteo(post=371991:date=May 7 2006, 10:45 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 7 2006, 10:45 PM) [snapback]371991[/snapback][/div][div class=\'quotemain\'][!--quotec--] One or many - depends on your coding style, for example You can [code]<?php echo "<H1>$title<H1>     <H3>Author : $author</H3>     <p>$content</p>     <p>Date : $article_date</p>"; ?>    [/code] or [code]<H1><?php echo $title ?><H1> <H3>Author : <?php echo $author ?></H3> <p><?php echo $content ?></p> <p>Date : <?php echo $article_date ?></p>[/code] [/quote] Ok thanks and to put them on different parts of a page u could put em in tables right? [!--quoteo(post=371999:date=May 8 2006, 12:00 AM:name=emehrkay)--][div class=\'quotetop\']QUOTE(emehrkay @ May 8 2006, 12:00 AM) [snapback]371999[/snapback][/div][div class=\'quotemain\'][!--quotec--] understanding this concept is what really opened php up for me. on the show more page you have to run another query based on the id passed in the url showmore.php?id=15 $id = $_GET['id']; //get the id from the querystring $query = "SELECT * FROM table WHERE id = ". $id .""; that query will return article number 15 [/quote] So would i mix both of your codes together? And would i need to put a connecting to database on this page?
  4. [!--quoteo(post=371970:date=May 7 2006, 07:27 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 7 2006, 07:27 PM) [snapback]371970[/snapback][/div][div class=\'quotemain\'][!--quotec--] When the user clicks the "Read more..." link the page "showmore.php" (or whatever you want to call it) will be loaded and the id of the article is passed to it in the querystring. That page then has to query the database table, using the id value, to display the article contents in full. [/quote] ok thanks and one last question With showing the differnt vairables on the pageh which shows the full article do you need to put lots of echos?
  5. [!--quoteo(post=371802:date=May 6 2006, 09:16 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 6 2006, 09:16 PM) [snapback]371802[/snapback][/div][div class=\'quotemain\'][!--quotec--] You still need to connect to your server and select the database, but as you are already writing to it I assume you know how to do that. [/quote] Ok Cheers mate [code]echo "a href='showmore.php?id=$id>Read more...</a>";[/code] With taht code u gave me does there need to be more information/ coding in a file named showmore.php
  6. teki

    Template?

    [!--quoteo(post=371815:date=May 6 2006, 11:47 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 6 2006, 11:47 PM) [snapback]371815[/snapback][/div][div class=\'quotemain\'][!--quotec--] How are you storing the form data? in a flat file database (txt file) or a nomal database (MySQL). [/quote] MySQL Database
  7. teki

    Template?

    Hey GUys I made a form for peoiple to submit news and I was wandering if i needed to make a special template of all the form names etc on a page so that the article data can be layed out properly?
  8. [!--quoteo(post=371789:date=May 6 2006, 06:42 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ May 6 2006, 06:42 PM) [snapback]371789[/snapback][/div][div class=\'quotemain\'][!--quotec--] Asuming each record has a unique auto_incrementing id column, then for all articles (latest first) [code]$sql = "SELECT id, title FROM articles ORDER BY id DESC";[/code] for latest x articles to be displayed [code]$x = 10; $sql = "SELECT id, title FROM articles ORDER BY id DESC LIMIT $x";[/code] For the read more bit, output a link containing the id of the record in the querystring [code]echo "a href='showmore.php?id=$id>Read more...</a>";[/code] [/quote] Thanks and is that code auto going to connect to the right database?
  9. Hey guys Recently i have been coding a php code which auto submits to a database. Can anyone supply me with a code of Showing the lastest article with a read more option Showing the latest ten with read more Showing all with read more
×
×
  • 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.