News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

What comes after the ? in a link is in the file

Started by kadhumia_flo, October 08, 2005, 10:32:21 AM

Previous topic - Next topic

kadhumia_flo

So basically

Something like this

link.php


<?php
echo '$blllaa';
?>


now, the $blllaa is determailed by what comes after the ? in the link

e.g www.tjkshjififa.com/link.php?blllaa=You%20Shouldnt%20be%20here

thats an example, now this link would say you shouldnt be here

Actually what i want it for really, is for external sites

i want something like = /link.php?link=www.hotmail.com

link.php will have 2 frames, and the second one is determained by what comes after ?link= in this case hotmail


Is This Possible, If so please advise

Thanx in Advance

Tomer

If you want the link [www.tjkshjififa.com/link.php?blllaa=You%20Shouldnt%20be%20here] to print out "you shouldnt be here".


<?php
echo $_GET['blllaa'];
?>

kadhumia_flo

That works great

Thanx  :D ;D

But i need help

So far i have

<?php
echo "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\n";
echo
"<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\n";
echo
"<title>New Page 1</title>\n";
echo
"</head>\n";
echo
"\n";
echo
"<frameset rows=\"64,*\">\n";
echo
"  <frame name=\"header.htm\" scrolling=\"no\" noresize target=\"main\" src=\"header.htm\">\n";
echo
"  <frame name=\"main\" src=\"$_GET['link']\">\n";
echo
"  <noframes>\n";
echo
"  <body>\n";
echo
"\n";
echo
"  <p>This page uses frames, but your browser doesn't support them.</p>\n";
echo
"\n";
echo
"  </body>\n";
echo
"  </noframes>\n";
echo
"</frameset>\n";
echo
"\n";
?>


But this is wat is shown

Quote
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/alshiac/public_html/link.php on line 9

Could you please help me

James Bone

<?php
echo "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\n";
echo
"<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\n";
echo
"<title>New Page 1</title>\n";
echo
"</head>\n";
echo
"\n";
echo
"<frameset rows=\"64,*\">\n";
echo
"  <frame name=\"header.htm\" scrolling=\"no\" noresize target=\"main\" src=\"header.htm\">\n";
echo
"  <frame name=\"main\" src=". $_GET['link'] .">\n";
echo
"  <noframes>\n";
echo
"  <body>\n";
echo
"\n";
echo
"  <p>This page uses frames, but your browser doesn't support them.</p>\n";
echo
"\n";
echo
"  </body>\n";
echo
"  </noframes>\n";
echo
"</frameset>\n";
echo
"\n";
?>

Elmacik

this one is very clearer i think :)

<?php
echo '<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<frameset rows="64,*">
 <frame name="header.htm" scrolling="no" noresize target="main" src="header.htm">
 <frame name="main" src=". $_GET['
link'] .">
 <noframes>
 <body>
 <p>This page uses frames, but your browser doesn\'t support them.</p>
 </body>
 </noframes>
</frameset>'
;
?>
Home of Elmacik

Saleh

yeah, why would have many echo's? just one is enough :)

We don't need a reason to help people

Elmacik

Home of Elmacik

James Bone

I agree, but just made it work for the way he coded it.


kadhumia_flo

----

Hi, could some1 now assist me with this:

incude($_GET['link'])
doesnt work while
include('Header.htm')
does

I have also tryed
. $_GET['link'] .
$_GET['link'] .
"$_GET['link']"
". $_GET['link'] ."

Nothing seems to work#



Thanx in advance

Saleh

this is by far, one of the most serious security holes you can make!
include($_GET['link']); is fatal!
you should sanitize it.

We don't need a reason to help people

kadhumia_flo

thank you Saleh

If this is not possible, how about:

if ($GETLINK=1)
{include home.htm}
if ($getlink=2}
{include services.htm}

i know this is very inaccurate script...
Is there a way to do this?

Advertisement: