Forum Moderators: coopster

Message Too Old, No Replies

Variables by URL

         

Penaf

12:07 pm on Aug 22, 2005 (gmt 0)

10+ Year Member



Hello

Hi have a simple php script that gets the website URL from a form... puts it on a variable and calculates Link Popularity. How can I get this to work passing the site URL by the address instead of the form.

[php]
<?php
if(isset($_GET['getlp'])){
// Edit this to your website url:
$myWebSite = ($_POST['url']);
[/php]

I go to
[localhost...]
On the form I introduce my site and the address becomes
[localhost...]
How can I avoid introducing the address and make the script assume that the address it needs its the address where it's being host?

Thanks in advance

volatilegx

2:54 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change:
$myWebSite = ($_POST['url']);

To:
$myWebSite = ($_GET['url']);

Then, when you call the script, call it like this:

[localhost...]