Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Really Really Easy Sorry!!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Really Really Easy Sorry!!!

Postby digitalbloke » Tue Jul 01, 2003 7:07 am

Hi im sure you have been asked this many times!

if i have index.php?text=hello

how do i print that into a webpage??


Thanks


Digitalbloke
digitalbloke
New php-forum User
New php-forum User
 
Posts: 59
Joined: Tue Jul 01, 2003 7:02 am

Postby Joan Garnet » Tue Jul 01, 2003 7:38 am

Using this:
Code: Select all
echo $_GET ["text"];
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby digitalbloke » Tue Jul 01, 2003 7:48 am

as im sure you will have worked out im new 2 php

is this correct cos i get an error

Code: Select all
<? include("pages/" . "echo $_GET ["page"];") ?>
digitalbloke
New php-forum User
New php-forum User
 
Posts: 59
Joined: Tue Jul 01, 2003 7:02 am

Postby Joan Garnet » Tue Jul 01, 2003 7:59 am

Too many quotes:
Code: Select all
<? include( "pages/" . echo $_GET ["page"]; ) ?>
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby digitalbloke » Tue Jul 01, 2003 8:02 am

i now get Parse error: parse error, unexpected T_ECHO
digitalbloke
New php-forum User
New php-forum User
 
Posts: 59
Joined: Tue Jul 01, 2003 7:02 am

MAke code..

Postby ruturajv » Tue Jul 01, 2003 8:18 am

Why don't you use this
Code: Select all
$location = 'pages/' . $_GET['whatever'];
include($location);
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby Joan Garnet » Tue Jul 01, 2003 8:23 am

Code: Select all
<? include( "pages/" . echo $_GET ["page"] );  ?>

Sorry, this one should work as well as the one right before :D
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.