Jump to content

[SOLVED] Dynamic requirement of include file?


YourNameHere

Recommended Posts

session_start();
require('../config.php');
$classfunction = $race . '-functions.php';
//require($classfunction);
$con = mysql_connect($server, $db_user, $db_pass);
mysql_select_db($db); 
// Insert into chars
$sql = "Insert Into 'chars' (cname, class, owner, race) values ('$name', '$class', '$player', '$race')";
$result = mysql_query($sql);
//Insert into CharStats
$sql = "Insert Into 'charStats' (cname, dex, str, wis, int, con, cha, dexMod, strMod, wisMod, intMod, conMod, chaMod, ac, will, fort, ref, hp, speed, perception, init )
values ('$name', '$dex', '$str', '$wis', '$int', '$con', '$cha', '$dexMod', '$strMod', '$wisMod', '$intMod' '$conMod', '$chaMod', '$ac', '$will', '$fort', '$ref', '$hp', '$speed', '$perception', '$dexMod')";
// Set Variables
$race= $_POST['race'];

Yes Thorpe, I saw that I posted the wrong one and fixed it sorry.

 

It worked when I did it your way but I thought that you could define something anywhere in your code and use it anywhere as opposed to the way javascript does it where you have to define THEN use. I cant remember where I was tought that.

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.