Jump to content

t4newman

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by t4newman

  1. Sorry, you are quite correct. The last of the two variables needed to be 'variable" so that the text file would look like this:- $myvar1 = 'varvalue1'; $myvar2 = 'varvalue2';a $myvar3 = 'varvalue3'; I sorted it in the end but have had to abandon it due to the permission problem - no time left for this part.
  2. "I need the variable encapsulated in quotes for it to work." I found the right format through trial and error:- $Data = '$htURL = ' . "'" . $serverpath . "';\r\n"; However, it appears that I can't write a text file to the web server/host due to permission restrictions. I've ran out of time on the assignment I'm doing so will just explain the documentation to my tutor how you change the config text file manually.
  3. Help! This is doing my head in - the following writes the correct config file data to a text file but I need the variable encapsulated in quotes for it to work. $Data = '$htURL = ' . $serverpath . "\r\n"; fwrite($Handle, $Data); Running out of time and lose the will on this one....
  4. I'm trying to get the home page to redirect to prompt for config information if the database doesn't exist. <?php //Refer to config file/common functions include('utils.php'); $page4config = $htURL . $configpage; $databaseName = $dbName; if (!mysql_select_db($databaseName)) { //database not present or no server (MySQL) connection header("Location: $page4config"); exit(); } else { // db exists } ?> However, it errors with:- Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\xampp\ccn\index.php on line 6 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\xampp\htdocs\xampp\ccn\index.php on line 6 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\xampp\ccn\index.php:6) in C:\xampp\htdocs\xampp\ccn\index.php on line 8
  5. Help. I need to write a php script that when a site is first uploaded and runs the home page checks if a database exists, and if not, asks for config data to create the database and save that data in a file on the server, to use from then on. Any help appreciated.
  6. What about <not equal to> NULL?
  7. I'm checking to see if two values from a form are not null - I've tried several variations but no joy... if ($var1 != "" AND $var2 != "") { do this } else { do this }
  8. I'm inserting a row of data into a MySQL database and all of the data except two dates correctly get added to the row. I know what the problem is but I'm not sure of the solution... I'm getting a user to input UK format dates (location of users) but the database is showing 0000-00-00 which I suspect is because it is only recognising US format dates (YYYY-MM-DD). I'm using date_default_timezone_set($zondatetime); and feeding that variable with 'Europe/Paris' but it's not making any difference. Any help very much appreciated.
×
×
  • 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.