Jump to content

Another Noob question


shage

Recommended Posts

If you mean example.com/index.php?josh=birthday, then $_GET['josh'] will contain "birthday".

But I guess you want to use example.com/index.php?name=josh&event=birthday, where $_GET['name'] would contain "josh" and $_GET['event'] would contain "birthday".

Link to comment
https://forums.phpfreaks.com/topic/76796-another-noob-question/#findComment-388813
Share on other sites

Okay, if your URL's look like example.com/josh=birthday you could use explode() to get "josh" and "birthday":

 

<?php
$url = $_SERVER['REQUEST_URI']; // will set $url to "/josh=birthday"
$removeslash = explode('/', $url); // $removeslash[1] now contains "josh=birthday"
$bits = explode('=', $removeslash[1]);
// $bits[0] contains "josh"
// $bits[1] contains "birthday"
?>

Link to comment
https://forums.phpfreaks.com/topic/76796-another-noob-question/#findComment-388998
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.