Current location: Hot Scripts Forums » Programming Languages » PHP » dynamic php page.


dynamic php page.

Reply
  #1 (permalink)  
Old 03-31-04, 02:15 PM
tehnoobe tehnoobe is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dynamic php page.

Hello,

I am working on making a page dynamic.

i have a list of services on the left corner of the page and i want to load a details of the service on the right side. the page should reload on click of a link and no frames are being used.

I thought of using server side includes based on a variable passed by the url. so far i have been unsucess full due to my limited knowladge of php syntax.

Code:
http://www.domain.com/scanning2.php?service=one[/url] <- variable passed by url.

<?php $_GET[serivce]; ?> <-picking the variable
<?php if $service == 'one ?> <-checking the value? 
<?php include(one.htm); ?> <-loading the include?
how to i make this work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-31-04, 07:02 PM
azteck azteck is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
...and here's the solution
<?
if($_GET['service']=='one' )include("one.html");
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-01-04, 11:53 AM
tehnoobe tehnoobe is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
that worked very well! thank you!!!

another quick question, i need to redirect the user to a defualt service page if the service=''[null] or not one that is listed. i tried the following but no luck.

Code:
$URL="http://www.domain.com/services.php";
if($_GET['service']=='' ) header ("Location: $URL");
:\
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 04-01-04, 07:44 PM
Mud Mud is offline
Newbie Coder
 
Join Date: Sep 2003
Location: Southern California
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
<?php
if (empty($page))
{
include ("news.php");
}
else
{
include ("$page.php");
}
?>
is what I use and if i want to link somewhere i have a llink called index.php?page=hello
and then i create a page called hello.php and it works@!
__________________
http://websoftblog.com/ - Web Software Blog
http://www.seekpire.com/ Make money searching!
http://www.gamingwise.com/ flash games!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 04-02-04, 12:49 PM
ornoc ornoc is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:
PHP Code:

<?php

if(!isset($_GET['service']))
{
include (
"services.php");  //or however you want to redirect
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i make php open another web page? wonderland PHP 6 09-23-08 07:55 PM
Classified Ads skipper23 Perl 3 11-22-05 03:22 AM
question about updating a page or database for an, php and mysql updating mikewooten PHP 1 02-12-04 01:11 AM
php on a html page Bonzo PHP 9 02-06-04 11:40 PM
Classified Ads skipper23 Perl 2 12-30-03 04:43 AM


All times are GMT -5. The time now is 08:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.