Page 1 of 2

Converting from ?id=blah to ?blah [56k warning]

Posted: Fri Jul 15, 2005 3:13 pm
by theda
Edit: I am going to rephrase myself to alleviate confusion...

1. Source code
--http://dumbass.ionichost.com/img/source_main.php
--http://dumbass.ionichost.com/img/source_index.php

2. The parts to be aware of:
--Anything that has ?id= or $id sitting in it. (Mostly on main source page)
--Anything that says "URL, PAGE, LOAD IDENTITY" (Mostly on index source page)
--http://www.invano.com/'s "Invano Navigation PHP Tutorial"

3. Questions
--How would I integrate Invano's url explode script so that it reduces ?id=blah to ?blah, while still integrating my current news/content include page (That also has a "if file exists, load the content, if not, auto load the news page")
--How do I keep my "Page Last Modified" snippet working, as it requires the definition of "$id" to be present, which if the Invano snippet is substituted, then $id wouldn't be defined, leaving errors like "Cannot find .php page on main.php line XX"

4. Notes
--I have no access to the core PHP files, only my scripts (aka, I can't access the php installation_
--I cannot edit .htaccess on my server

Posted: Fri Jul 15, 2005 3:27 pm
by bokehman
Your server would need mod_rewrite to do this

Posted: Fri Jul 15, 2005 3:37 pm
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Fri Jul 15, 2005 3:40 pm
by x4t
bokehman wrote:Your server would need mod_rewrite to do this
You can also reach the goal with Multiviews :-)

Posted: Fri Jul 15, 2005 3:44 pm
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Fri Jul 15, 2005 3:50 pm
by bokehman
theda wrote:What exactly is that?
An apache module

Posted: Fri Jul 15, 2005 3:51 pm
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Sat Jul 16, 2005 12:58 am
by bokehman
theda wrote:I can only use PHP for this... if you havent guessed already.
The query string is read and interpreted by the server and passed to the php script so if you want the it rewritten you will need that module.

Posted: Sat Jul 16, 2005 1:36 am
by x4t
theda wrote:I can only use PHP for this... if you havent guessed already.
Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4tthis... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

&lt;?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER&#1111;'PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i &lt; $num_param; $i += 2)
            $get&#1111; $vardata&#1111;$i] ] = $vardata&#1111;$i+1];
    }
    return $get;
}

?&gt; quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER&#1111;'PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i &lt; $num_param; $i += 2)
            ltiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER&#1111;'PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i &lt; $num_param; $i += 2)
            $get&#1111; $vardata&#1111;$i] ] = $vardataisn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
         "theda"]I can only use PHP for this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews()[/b:20427d4c"theda"]I can only use PHP for this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t= 0)
{
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4tet;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardatod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
         if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t]
RewriteEngine On
Options MultiViews

(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultmp;lt;?php
function parseMultiviews()
{
$get = array();
if(!empty($_SERVER['PATH_INFO']))
{
$vardata = explode('/', $_SERVER['PATH_INFO']);
$num_param = count($vardata);

if($num_param % 2 == 0)
{
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best ex only use PHP for this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t20427d4cb8]
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al argumenseMultiviews()
{
$get = array();
if(!empty($_SERVER['PATH_INFO']))
{
$vardata = explode('/', $_SERVER['PATH_INFO']);
$num_param = count($vardata);

if($num_param % 2 == 0)
{
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t11; $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t
RewriteEngine On
Options MultiViews

(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i &lt; $num_param; $i += 2)
            $get&#1111; $vardata&#1111;$i] ] = $vardata&#1111;$i+1];
    }
    return $get;
}

?&gt; 
ultiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example th
if($num_param % 2 == 0)
{
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t"theda"]I can only use PHP for this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata&#11!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4tr this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews()[/b:20427d4cess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4tfor this... if you havent guessed already.[/quote]

Mod rewrite isn't PHP either. Multiviews is.
You'll have to add this to a .htaccess file;

Code: Select all

RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER&#1111;'PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i &lt; $num_param; $i += 2)
            $get&#1111; $vardata&#1111;$i] ] = $vardata&#1111ions MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata&#1111;] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[4cb8]
RewriteEngine On
Options MultiViews
(sometimes +Multiviews)

Than you'll have to use a code like

Code: Select all

<?php
function parseMultiviews()
{
    $get = array();
    if(!empty($_SERVER['PATH_INFO']))
    {
        $vardata = explode('/', $_SERVER['PATH_INFO']);
        $num_param = count($vardata);
    
        if($num_param % 2 == 0)
        {
            $vardata[] = '';
            $num_param++;
        }
        for($i = 1; $i < $num_param; $i += 2)
            $get[ $vardata[$i] ] = $vardata[$i+1];
    }
    return $get;
}

?>
(very fast typed and not the best example though)

If you then call VER['PATH_INFO']))
{
$vardata = explode('/', $_SERVER['PATH_INFO']);
$num_param = count($vardata);

if($num_param % 2 == 0)
{
$vardataŃ—] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
ret
<?php
function parseMultiviews()
{
$get = array();
if(!empty($_SERVER['PATH_INFO']))
{
$vardata = explode('/', $_SERVER['PATH_INFO']);
$num_param = count($vardata);

if($num_param % 2 == 0)
{
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2)
$get[ $vardata[$i] ] = $vardata[$i+1];
}
return $get;
}

?>

(very fast typed and not the best example though)

If you then call parseMultiviews(), the script will parse al arguments behind the =.

x4t

Posted: Sat Jul 16, 2005 2:44 am
by bokehman
I can't see how that is connected to what he wants to do. It would seem that all he wants to do is get rid of the crufty uri.

Posted: Sat Jul 16, 2005 9:21 am
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Sat Jul 16, 2005 9:43 am
by Roja
The links to source code you posted are to *localhost*. We cannot see the code, so we can't give any advice on how to change the code.

As a general statement, I'd say if you are already using the $id variable in one script, and the new script conflicts, do a search replace of that variable.

However, with no information beyond that, like being able to see the code, I can't give an accurate answer.
theda wrote:So please, quit giving me the same WRONG answer.
I sincerely encourage you to adjust your attitude. People are trying to help you, and you are not only insulting them, you are also being rude in exchange. This is a learning forum - many of the members (yourself included, since you have questions to ask) still are not perfect.

The fact that they are attempting to help you is why you are here. Continued rude responses to attempts at helping you can ensure that you will get few or no responses from the people that visit often.

Posted: Sat Jul 16, 2005 9:58 am
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Sat Jul 16, 2005 10:00 am
by theda
Edit: I have rephrased my original post, please refer to it for latest information.

Posted: Sat Jul 16, 2005 10:26 am
by Roja
theda wrote:LMAO! Oopsies, sorry about that... I used the wrong url
Which script on invano are you trying to integrate that causes a conflict?
theda wrote:You don't know how annoying it is asking a specific answer, having people answer the wrong question, tell them something even more specific and get the same exact answers even after the fact...
I'd guess it's somewhere close to you continuing to be rude (to the people you are asking for help!) when I've asked you to try to be a little appreciative that ANYONE is willing to help you.

You aren't perfect, and neither is anyone on these forums. If you want perfect answers, go pay google answers. These forums are for learning - learning often means you will get wrong answers to get to the right answer.