•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,580 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,610 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 752 | Replies: 6 | Solved
![]() |
i forgot how to split urls 
i m trying to get 1,1,1,10.html n assign each value before commas to variables
any ideas??

php Syntax (Toggle Plain Text)
$url = "http://www.myhost.com/1,1,1,10.html";
i m trying to get 1,1,1,10.html n assign each value before commas to variables
any ideas??
Do a favour, leave me alone
<?php
$urloriginal = "http://www.mazur.com.ar/galeria/index.php?id=25";
echo "URL original: " . $urloriginal . "<br><br>\n";
$urloriginal = eregi_replace("http://", "", $urloriginal);
echo "URL original sin http//: " . $urloriginal . "<br><br>\n";
$parametros = stristr($urloriginal, "/");
echo "The request part: " . $parametros . "<br><br>\n";
$dominio = substr($urloriginal, 0, strpos($urloriginal, "/"));
echo "El dominio es: $dominio";
?>
ch.-
$urloriginal = "http://www.mazur.com.ar/galeria/index.php?id=25";
echo "URL original: " . $urloriginal . "<br><br>\n";
$urloriginal = eregi_replace("http://", "", $urloriginal);
echo "URL original sin http//: " . $urloriginal . "<br><br>\n";
$parametros = stristr($urloriginal, "/");
echo "The request part: " . $parametros . "<br><br>\n";
$dominio = substr($urloriginal, 0, strpos($urloriginal, "/"));
echo "El dominio es: $dominio";
?>
ch.-
yes i did.. but it s not the thing i want.
i will work on it
i will work on it
php Syntax (Toggle Plain Text)
<? // i add this part $_SERVER['FULL_URL'] = 'http'; if($_SERVER['HTTPS']=='on'){$_SERVER['FULL_URL'] .= 's';} $_SERVER['FULL_URL'] .= '://'; if($_SERVER['SERVER_PORT']!='80') $_SERVER['FULL_URL'] .= $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'].$_SERVER['SCRIPT_NAME']; else $_SERVER['FULL_URL'] .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; if($_SERVER['QUERY_STRING']>' '){$_SERVER['FULL_URL'] .= '?'.$_SERVER['QUERY_STRING'];} $url = $_SERVER['FULL_URL']; $urloriginal = $url; echo "URL original: " . $urloriginal . "<br><br>\n"; $urloriginal = eregi_replace("http://", "", $urloriginal); echo "URL original sin http//: " . $urloriginal . "<br><br>\n"; $parametros = stristr($urloriginal, "/"); echo "The request part: " . $parametros . "<br><br>\n"; $dominio = substr($urloriginal, 0, strpos($urloriginal, "/")); echo "El dominio es: $dominio"; ?>
Last edited by fatihpiristine : Nov 5th, 2007 at 10:31 am.
Do a favour, leave me alone
tested and works ok..
another thing.. this is my url
http://www.blabla.com/en/category/25698
assignment:
language = en
category = category
id = 25698
sql does the query but when i redirect to this location i got 404 error.
how can i solve this?s
another thing.. this is my url
http://www.blabla.com/en/category/25698
assignment:
language = en
category = category
id = 25698
sql does the query but when i redirect to this location i got 404 error.
how can i solve this?s
Last edited by fatihpiristine : Nov 5th, 2007 at 4:15 pm.
Do a favour, leave me alone
i figured out. with htaccess file 
RewriteEngine On
RewriteRule ^\.htaccess$ - [F] #to avoid accessing .htaccess files
RewriteRule ^\.jpg$ - [F] #jpg
RewriteRule ^\.html$ - [F] # htmls
RewriteRule ^\.css$ - [F] # css
RewriteRule ^([0-9]+),([0-9]+)$ /index.php?Language=$1&Index=$2 [L]

RewriteEngine On
RewriteRule ^\.htaccess$ - [F] #to avoid accessing .htaccess files
RewriteRule ^\.jpg$ - [F] #jpg
RewriteRule ^\.html$ - [F] # htmls
RewriteRule ^\.css$ - [F] # css
RewriteRule ^([0-9]+),([0-9]+)$ /index.php?Language=$1&Index=$2 [L]
Do a favour, leave me alone
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Save Time and Effort in Typing URL Addresses (Windows tips 'n' tweaks)
- a non-destructive repartitioning tool? (*nix Software)
- Splitting Files ., Making them fit to a CD (Windows NT / 2000 / XP / 2003)
- IE Cache not deleting a URL (Web Browsers)
- URL Changes!! (Web Browsers)
- IE URL Suffix (Web Browsers)
- url redirects to yahoo.com (Windows NT / 2000 / XP / 2003)
Other Threads in the PHP Forum
- Previous Thread: MySQL vs. SQL Server
- Next Thread: What's going on here?


Linear Mode