Jump to content

josephsprint

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

josephsprint's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK I'm an idiot i was putting the get part in the wrong place, it now works as expected. Thanks loads.
  2. OK I fixed the syntax of the script, it now looks like: [code] <?php switch($id) {     case "issue1cd":     include ('issue1cd.php');     break;     case "issue2cd":     include ('issue2cd.php');     break;     case "issue3cd":     include ('issue3cd.php');     break;     case "issue4cd":     include ('issue4cd.php');     break;     default:     require ('issue1cd.php'); } ?> [/code] If I add [b]$id = $_GET['id'];[/b] to the top of the script it stops working all together and just shows a blank page. Now this is the bit I missed before. The switching isn't actually working anyway, each link just displays the default include even though the address bar changes. I made each include different now to make sure. Many Thanks
  3. Hi, Thanks for the replys, the double quote worked perfectly but only when appplied to everything, also when I add the $id = $_GET['id']; it just makes the screen go blank but it works without anyhow. I don't know what globals are or what on/off means.
  4. Hi, I followd a very simple tutorial on dynamic content and I can't seem to get it working even though it appeared to be the same. This is my first go at PHP. Can anyone help me solve what's going wrong. [a href=\"http://www.josephsprint.co.uk/test/mono/reviews.php\" target=\"_blank\"]http://www.josephsprint.co.uk/test/mono/reviews.php[/a] following code points to a few include files in the same directory. [code] <div id="side1"> <h2>CD Reviews</h2> <?php switch($id) { case ’issue1cd’: include ’issue1cd.php’; break; case ’issue2cd’: include ’issue2cd.php’; break; case ’issue3cd’: include ’issue3cd.php’; break; case ’issue4cd’: include ’issue4cd.php’; break; default: require ’issue1cd.php’; } ?> </div> [/code] This is the include file- 'issue1cd.php' [code] <ul> <li>White Light Parade</li> <li>Ruby Tombs</li> <li>This Et Al</li> </ul> <p> Issue: <a href="reviews.php?id=issue1cd">1,</a> <a href="reviews.php?id=issue2cd">2,</a> <a href="reviews.php?id=issue3cd">3,</a> <a href="reviews.php?id=issue4cd">4,</a> <a href="reviews.php?id=issue5cd">5,</a> </p> [/code] It seems simple enough but I don't know what's wrong. I would also like to know if I can put my includes into a folder called includes, in that case what does 'case' point to? Cheers, Jo
×
×
  • 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.