| | |
Simple (I think) Code Question
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Can anyone tell me how I would code links to other pages on my site (using php) whereby the full URL in the address bar looks like this:
http://www.mysite.com/index.php?id=3 (which points to blah.php)
I've done the usual searches on google and such with no luck on how to do it.
Mind you, I'm *not* a coder/webmaster so if you start talking about arrays and such, I'll have no idea what you're talking about :)
http://www.mysite.com/index.php?id=3 (which points to blah.php)
I've done the usual searches on google and such with no luck on how to do it.
Mind you, I'm *not* a coder/webmaster so if you start talking about arrays and such, I'll have no idea what you're talking about :)
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
•
•
Join Date: Jul 2004
Posts: 234
Reputation:
Solved Threads: 8
I assume you want to redirect from http://www.mysite.com/index.php?id=3 to http://www.anothersite.com/blah.php
You can use header() function to do it.
If not, post here again.
You can use header() function to do it.
If not, post here again.
No, what I want to do is hide the actual page link, so the URL reads:
http://www.mysite.com/index.php?id=2
instead of:
http://www.mysite.com/iwanttohidethispage.html
No redirection to another domain, just hiding the actual pages from showing up in the location bar of the browser. For an example, please see http://www.cacert.org
http://www.mysite.com/index.php?id=2
instead of:
http://www.mysite.com/iwanttohidethispage.html
No redirection to another domain, just hiding the actual pages from showing up in the location bar of the browser. For an example, please see http://www.cacert.org
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
•
•
Join Date: Jul 2004
Posts: 234
Reputation:
Solved Threads: 8
Well, it's mod_rewrite. You can check out at http://www.mod-rewrite.com/forum/thread10.html
hmm. sounds to me like a simple include, but that's probably inefficient.
[PHP]
<?php
$pages = "/path/to/pages/";
$default = 1;
if(is_file($pages.$_GET['id'].".php")) $p = $_GET['id'];
else $p = $default;
include $pages.$p.".php";
?>
[/PHP]
Just have all your pages as ID numbers.. IE: news page = 3.html
But that's really inefficient, and probably not how you do it =P
[PHP]
<?php
$pages = "/path/to/pages/";
$default = 1;
if(is_file($pages.$_GET['id'].".php")) $p = $_GET['id'];
else $p = $default;
include $pages.$p.".php";
?>
[/PHP]
Just have all your pages as ID numbers.. IE: news page = 3.html
But that's really inefficient, and probably not how you do it =P
Current languages this technical polyglot knows:
PHP
Languages this technical polyglot is working on:
C++
Java
XML
PHP
Languages this technical polyglot is working on:
C++
Java
XML
![]() |
Similar Threads
- Simple Winsock Question? (C++)
- Simple Array() question (PHP)
- Simple code help (Python)
- Here's a mess of code without a question (renamed from garbage) (C++)
- ultra simple function question (C++)
- simple code (C++)
- CAn anyone provide me a very simple code for shopping cart? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Zend PHP Certification
- Next Thread: Error when editing PHP lines in a theme file.
| Thread Tools | Search this Thread |
advanced alerts apache api archive array autosuggest beginner binary broken cakephp checkbox class clients cms code cron curl database date display dynamic echo email emptydisplayvalue eregi error execute explodefunction file files folder form forms function functions google hack href htaccess html if...loop image include insert ip javasciptvalidation javascript joomla keywords library limit link login mail matching menu mlm multiple mysql object oop password paypal pdf php phpincludeissue problem query radio random recursion recursive remote script search searchbox server sessions shot smarty sms source space speed sql syntax system table tutorial update upload url validator variable vbulletin video web website youtube





