| View previous topic :: View next topic |
| Author |
Message |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Fri Oct 30, 2009 3:25 pm Post subject: Simple php (probably) need help |
|
|
ok I've seen many pages that are like this http://domain.com/download/directx.php?type=win
Ok now i've got a question, how can I do this. For example if it's ?type=win then it opens one page, but if it's ?type=mac it opens another page.
P.S. do these things have names?
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Fri Oct 30, 2009 4:09 pm Post subject: |
|
|
Ok.. but people don't actually see the "php queries" (yes I know how they are called now ) and that tutorial didn't actually told how to make links with queries..
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Fri Oct 30, 2009 4:15 pm Post subject: |
|
|
I think you have to use javascript for that.
Simple example
The javascript should then redirect the user to a page with the appropriate php query.
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Fri Oct 30, 2009 4:50 pm Post subject: |
|
|
I am in http://domain.com
I have a page called stuff.php
I also have a page called lol.php
i want people to access to lol.php vial stuff.php?=lol
is it possible?
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Oct 30, 2009 5:01 pm Post subject: |
|
|
| Code: | // file.php?a=x
<?php
echo "a is ", $_GET['a'];
?> |
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Oct 30, 2009 5:13 pm Post subject: |
|
|
display.php
| Code: |
<?php
$page = $_GET["page"];
include($page . ".php");
?>
|
Example URL:
http://www.foo.com/display.php?page=bar
Very basic example, but you want to edit it so that it isn't vulnerable to LFI (Local File Inclusion). A simple way to do this is by disallowing special characters in variables. Some of those characters being "/", "\", "." (minus the quotes).
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Sat Oct 31, 2009 2:52 am Post subject: |
|
|
| oib111 wrote: | display.php
| Code: |
<?php
$page = $_GET["page"];
include($page . ".php");
?>
|
Example URL:
http://www.foo.com/display.php?page=bar
Very basic example, but you want to edit it so that it isn't vulnerable to LFI (Local File Inclusion). A simple way to do this is by disallowing special characters in variables. Some of those characters being "/", "\", "." (minus the quotes). |
Thank you man, it worked really great that's what I was looking for
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Oct 31, 2009 10:02 am Post subject: |
|
|
No problem
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
CourtneyMarie How do I cheat?
Reputation: 0
Joined: 27 Oct 2009 Posts: 4
|
Posted: Mon Nov 02, 2009 3:41 am Post subject: |
|
|
It's a simple $_GET['type']; command!
example
| Code: |
<?php
$type = $_GET['type'];
echo $type;
?>
|
Now save that under index.php
simply do
yourdomaincom/index.php?type=mac
and the page will display mac.. then you can redirect it using include
| Code: |
<?php
$type = $_GET['type'];
if($type == "mac")
include("mac.php");
else
include("win.php");
?>
|
enjoy
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Nov 03, 2009 3:40 pm Post subject: |
|
|
| oib111 wrote: | display.php
| Code: |
<?php
$page = $_GET["page"];
include($page . ".php");
?>
|
Example URL:
http://www.foo.com/display.php?page=bar
Very basic example, but you want to edit it so that it isn't vulnerable to LFI (Local File Inclusion). A simple way to do this is by disallowing special characters in variables. Some of those characters being "/", "\", "." (minus the quotes). |
Rofl.
Better:
| Code: | <?php
if(!isset($_GET['p']))
die("failed");
header(sprintf("Location http://www.yourdomain.com/%s.php", $_GET['p']));
?> |
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Nov 03, 2009 6:07 pm Post subject: |
|
|
Not sure what you find so hilarious about my post that it makes you "rofl". Never said my code was perfect, in fact I said it needed to be edited.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Nov 03, 2009 6:52 pm Post subject: |
|
|
| oib111 wrote: | | Not sure what you find so hilarious about my post that it makes you "rofl". Never said my code was perfect, in fact I said it needed to be edited. | Well that's what you get from a mediocre programmer, a snippet that's full of exploits and bugs.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Nov 03, 2009 7:24 pm Post subject: |
|
|
I intentionally left it with bugs/vulnerabilities. If it had bugs/vulnerabilities simply because of my own incompetence then yes, you could say I'm mediocre PHP programmer.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Nov 03, 2009 7:38 pm Post subject: |
|
|
| oib111 wrote: | | I intentionally left it with bugs/vulnerabilities. If it had bugs/vulnerabilities simply because of my own incompetence then yes, you could say I'm mediocre PHP programmer. | Oh yes, teach him with a exploit infested snippet.
|
|
| Back to top |
|
 |
|