information display

  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

this sounds really stupid and really strange to figure out. so i need some help with this. when i go to the page index.php i get the welcom info up. when i then press the button for index.php?id=1 i get the id=1 info with the welcom text at the bottom. how do i take the index page text off?
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago


If the index.php?id=1 is including a script into the page, and your 'index' page has text on it already, you can enter

PHP Code: [ Select ]
after it, which cuts the rest of the page off. However, this isn't very good for browser display issues and you're better off making a check to see if id is set and, if it is, hide the text of the index page
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

I may not understand your issue... but... (this code will not be perfect... it's intended to only be a guideline)

Code: [ Select ]
 $id = $id_from_url;
 if($id == ""){
 elseif($id == 1){
  print "whatever is for ID = 1";

 ... and so forth ...
  1. <?
  2.  $id = $id_from_url;
  4.  if($id == ""){
  5.   print "YOUR WELCOME TEXT";
  6.  }
  7.  elseif($id == 1){
  8.   print "whatever is for ID = 1";
  9.  }
  10.  ... and so forth ...
  11. ?> 

There are much more efficient way to do this, though. The point is, you're going to populate a variable based on the id value. If that variable is null or empty or anything other than populated with data, you show the welcome.

If you're using a database, then it's even easier since you'll know from whether the database returned any records whether the ID variable is valid or not. If it is, good, if not show the default text. (this is standard practice anyway, as part of the "fail gracefully" strategy).


Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.