Heyas,
Im wondering how I could go about supplying variables to an external php script. This is my situation:
This script: usercount.php
<?
$db = mysql_connect('localhost','user','pass
mysql_select_db("db", $db);
$sql= "select count(*) as c from divx where user='$user'";
$res = mysql_query($sql , $db);
$result = mysql_fetch_array($res);
echo $result["c"] ;
?>
I want to be able to supply usercount.php using a small php tag below. This is how ive tried to do it but it doesnt work (parse error, unexpected ='. Can someone explain how I should do this? I imagine its pretty simple. I know I could type the url withe ?name=blah on the end but I intend on inserting the code below several times to perform different counts at different points on the page.
<?php
user="Stewart";
include "usercount.php";
?>
Thanks!