Jump to content


Photo

How to read the browser's url in php


  • Please log in to reply
2 replies to this topic

#1 kapishi

kapishi
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 March 2006 - 07:20 PM

Hello,

I want to read the browser's url in php and parse it. for e.g: [a href=\"http://www.abc.com?val=ab\" target=\"_blank\"]http://www.abc.com?val=ab[/a]

I want to check if 'val=' exists in the url(of browser). Please advice.

Thanks.

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 06 March 2006 - 07:27 PM

welcome to the forum! hope you find lots of great advice here.

to see if val= occurs in the query string of your current URL, simply use the isset() function:
if (isset($_GET['val']))
  // it is in the url
else
  // it's not in the url

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 kapishi

kapishi
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 March 2006 - 07:37 PM

It works! Thank you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users