Really Really Easy Sorry!!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

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

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

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

Using this:

Code: Select all

echo $_GET ["text"];

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

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"];") ?>

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

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

Too many quotes:

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 digitalbloke » Tue Jul 01, 2003 8:02 am

i now get Parse error: parse error, unexpected T_ECHO

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

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
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

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


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest