Jump to content

tsilenzio

Members
  • Posts

    134
  • Joined

  • Last visited

    Never

Everything posted by tsilenzio

  1. maybe if i do a require_once for the js files it would work then? (Provided the <html><head> settings have been decleared already)? :s
  2. If you are very confused on this (because of the way i explain) it let me know and i will try to clear it up the best i can
  3. Ok this is going to get confusing and i usally make it worse when i explain things but: I have a php page (index.php) which will see if ur logged in, if ur not then it loads up "templates/StarOne/login.htm". by doing: <?php //lines up above require_once("templates/StarOne/login.htm"); //lines below ?> The javascript files I use are in: "templates/--js/blah.js", "../--js/blahblah.js" So in the html files i do: <script src="../--js/blah.js" type="text/javascript"></script> And it will run on my PC with NO PROBLEMS at all however in my index page it loads up the login.htm it wont run the script at all it just goes to the next page. --------------- MY VERSION OF TRYING TO FIX IT (FAILURE HOWEVER) ---------------------- I thought possibly instead of doing to the html files (incase it runs the file from the main directory <script src="templates/--js/blah.js" type="text/javascript"></script> instead of: <script src="../--js/blah.js" type="text/javascript"></script> and it still dosnt work. Any ideas? (By the way all the script does right now is a validation confirm for user input fields) Thank you SOOOO much in advance
  4. yea lol im lazy if it saves me like 2 letters ill do it xD. Also i was kidna hoping i could come up with a way to make it eaiser to do it like for create, select, delete, drop.. and so on..
  5. yea i was thinking of a way to do that etheir diff function or possibly somrthing better well i got work tommrow and as always i do nothing so i got 8 hours to think of it, im hitting the sack its late here, thanx again guys!
  6. ok ill work on that lol (this is honestly my first time writing PHP code)
  7. sweet , by the way if you can make it better go ahead
  8. Is having a function to do querys good or bad? Like the following <?php // functions.php - All needed functions function processQuery($sql) { require_once("config.php"); if(!$result = mysql_query($sql, $conn)) { die(mysql_error()); } } ?> Incase you need it - config.php <?php // config.php - Database configurations // Hostname exp: localhost, www.somesite.com $db_hostname = "some_domain_name"; // User for database $db_username = "some_user"; // Password for database $db_password = "some_password"; // Database $db_database = "some_databadr"; $conn = mysql_connect($db_hostname, $db_username, $db_password); if (!$conn) { die("Couldn't connect to database"); } else { mysql_select_db($db_database, $conn); } ?> Main questions i have is will that work if i use like require_once(); functions [for other pages like login.php] , and will that ork or have you spoted an error? =/ Thanx in advance!
  9. Don't laugh but im new to php (not programming) I read somewhere that if u use mysql_connect (instead of mysql_pconnect) that u have to use it in every script. I was just wonderting if a script is from on <?php to ?> or if a script is from the top of the file to the end. (basically if it doesn't end the connecting after it encouters its first set of a ?> tag. Thanx in advance!
×
×
  • 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.