+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Help

  1. #1
    CascadesAdmin is offline x10Hosting Member CascadesAdmin is an unknown quantity at this point
    Join Date
    Jun 2007
    Posts
    87

    Help

    Hey, I ned some help with this:

    PHP Code:
    if(isset($_GET['p']))
    {
         
    $p $_GET['p'];
         include(
    $p.'.php');

    Where do I put it. I am trying to get it to work on this site: http://www.cascades.exofire.net i would also like it to be a=name instead of p=name.

    Help please!

    ``Frodo6695``
    Last edited by CascadesAdmin; 07-28-2007 at 01:26 PM.

  2. #2
    lambada's Avatar
    lambada is offline x10 Elder lambada is an unknown quantity at this point
    Join Date
    Mar 2006
    Location
    Caister, Gt Yarmouth, Norfolk, ENGLAND
    Posts
    1,222

    Re: Help

    For it to be 'a' and not 'p' then simply use
    PHP Code:
    if(isset($_GET['a']))
    {
         
    $a $_GET['a'];
         include(
    $a.'.php');

    Although I must say that this is a very insecure way of accessing a page.As someone could include ANY PHP file and not just the ones you want them to.

    As for where you put it, could you post the source of your page (the server is down atm).
    Lambada - the former Account Manager (before I resigned)




  3. #3
    CascadesAdmin is offline x10Hosting Member CascadesAdmin is an unknown quantity at this point
    Join Date
    Jun 2007
    Posts
    87

    Re: Help

    Which page?
    the home one?

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<meta http-equiv="Content-Style-Type" content="text/css" />
    	<title>Cascades Band</title>
    	<link href="style.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="favicon.ico" />
    </head>
    <body>
    <div id="wrapper">
    	<ul id="nav">
    		<li><a href="http://www.cascades.exofire.net/index.php?a=idx">Home</a></li>
    		<li><a href="http://www.cascades.exofire.net/index.php?a=band">Band</a></li>
    		<li><a href="http://www.cascades.exofire.net/index.php?a=shows">Shows</a></li>
    		<li><a href="http://www.cascades.exofire.net/index.php?a=contact">Contact</a></li>
    		<li><a href="http://www.cascades.exofire.net/index.php?a=extras">Extras</a></li>
    	</ul>
    	<h1><a href="/"><img src="images/logo1.gif" width="118" height="25" alt="Cascades Band" /></a></h1>
    	<div id="body">
    		<div id="bodyi">
    			<div id="bodyj">
    				<div id="sidebar">
    					<div class="content">
    						<h2>Info</h2>
    						<p>This site is currently under construction.</p>
    
    
    
    
    
    
    
    
    
    
    
    						<p class="readmore"><a href="http://www.freewebsitetemplates.com">Read More</a></p>
    					</div>
    					<div class="divider"></div>
    					<div class="content">
    						<h2><a href=http://news.cascades.exofire.net/show_news.php>Latest News &amp; Updates</a></h2>
    
    
    
    						<p class="readmore"><a href="http://news.cascades.exofire.net/rss.php">Read More</a></p>
    					</div>
    				</div>
    				<div id="content">
    					<img src="images/construction2.jpg" width="346" height="234" alt="Under Construction" />
    					<div class="content">
    						<h2>Latest Album</h2>
    						<p>No Albums Yet, Site under Construction.</p>
    						<p class="readmore"><a href="http://www.freewebsitetemplates.com">Read More</a></p>
    						<div class="divider"></div>
    						<h2>Hit List</h2>
    						<table summary="track downloads" border="0" cellspacing="0">
    						<tr>
    							<th width="55%">Tracks</th>
    							<th>Album</th>
    							<th class="hidden">Dowload links</th>
    						</tr>
    						<tr>
    							<td>None</td>
    							<td>None</td>
    							<td class="download"><a href="http://www.freewebsitetemplates.com">Download</a></td>
    						</tr>
    						<tr>
    							<td>None</td>
    							<td>None</td>
    							<td class="download"><a href="http://www.freewebsitetemplates.com">Download</a></td>
    						</tr>
    						<tr>
    							<td>None</td>
    							<td>None</td>
    							<td class="download"><a href="http://www.freewebsitetemplates.com">Download</a></td>
    						</tr>
    						<tr>
    							<td>None</td>
    							<td>None</td>
    							<td class="download"><a href="http://www.freewebsitetemplates.com">Download</a></td>
    						</tr>
    						</table>
    						<p class="readmore"><a href="http://www.freewebsitetemplates.com">More Tracks</a></p>
    					</div>
    				</div>
    				<div class="clear"></div>
    			</div>
    		</div>
    	</div>
    	<p id="power">Powered by <a href="http://www.freewebsitetemplates.com">Free Website Templates</a></p>
    </div>
    </body>
    </html>
    and do you have a more secure way of doing this?
    Edit:
    I am making a new design I have the template up for now.
    Last edited by CascadesAdmin; 07-30-2007 at 11:53 AM. Reason: Automerged Doublepost

  4. #4
    Corey's Avatar
    Corey is offline VPS Migration Professional Corey is a glorious beacon of lightCorey is a glorious beacon of light
    Join Date
    Dec 2004
    Location
    Northfield, NH
    Posts
    17,151

    Re: Help

    For an example, someone could include a PHP file that isn't even on your site by making a = http://x10hosting.com/includeFile

    Your site will now include http://x10hosting.com/includeFile.php (Doesn't exist). You would not want the user to be able to decide which pages to include on your site at all.

  5. #5
    CascadesAdmin is offline x10Hosting Member CascadesAdmin is an unknown quantity at this point
    Join Date
    Jun 2007
    Posts
    87

    Re: Help

    how do you secure it?

  6. #6
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: Help

    What do you mean by "securing" it?
    -Chris Z
    Retired Account Manager


  7. #7
    Corey's Avatar
    Corey is offline VPS Migration Professional Corey is a glorious beacon of lightCorey is a glorious beacon of light
    Join Date
    Dec 2004
    Location
    Northfield, NH
    Posts
    17,151

    Re: Help

    I don't believe it can be secured doing it the way you have it, the way you have it uses GET to allow the user to pass whatever they want to the script.

  8. #8
    t2t2t's Avatar
    t2t2t is offline x10 Elder t2t2t is an unknown quantity at this point
    Join Date
    Sep 2006
    Location
    Europe, Estonia
    Posts
    690

    Re: Help

    Hmm, sounds familiar...
    Quote Originally Posted by Chris Z View Post
    In order to do that, you would do something like:
    PHP Code:
    if(isset($_GET['p']))
    {
         
    $p $_GET['p'];
         include(
    $p.'.php');

    "$p" would be your page. So if this script was called index.php, you'd do index.php?p=pizza to include the page: pizza.php

    Does that answer your question?
    2 CascadesAdmin: *sigh* Thats basic php, so if you have questions, check this first
    Last edited by t2t2t; 07-30-2007 at 02:03 PM.
    This post has been marked spam 52 times.


  9. #9
    CascadesAdmin is offline x10Hosting Member CascadesAdmin is an unknown quantity at this point
    Join Date
    Jun 2007
    Posts
    87

    Re: Help

    yeah, its not like they have that exact code on the page. and I just asked for help with it...

  10. #10
    Zenax's Avatar
    Zenax is offline Lord Of The Keys Zenax is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,339

    Re: Help

    Gimme a week (its when i return home) and I will send you an old script I used for that sort of thing. I was told it was secure!
    Regards,
    Zenax

+ Reply to Thread
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers