Jump to content

Guardian-Mage

Members
  • Posts

    341
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.northernlightstech.com/

Profile Information

  • Gender
    Male
  • Location
    Earth

Guardian-Mage's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. That wouldn't fix the problem because of where the error is occuring. It is not occuring in the data field section, but in the column name section. -Guardian Mage
  2. I believe one of your column names is a reserved syntax word. To avoid this, surround the column names with a backtick, `, and values with a single quote, '. <?php $query = "INSERT INTO `equipment` (`DistrictTag`, `SerialNumber`, `Type`, `Type1`, `Model`, `DateofPurchase`, `Grant`, `Building`, `Room`, `Status`, `Specs`, `WorkedOn`) VALUES('$districtId', '$serialId', '$type', '$type1', '$model', '$dateofPurcahse', '$grant', '$building', '$room', '$status', '$specs', '$workedOn');"; echo "<br /><br />"; mysql_query($query, $db) or die(mysql_error($db) . '<br />' . $query); ?> Oh, and Google would have given you the answers to your question You might consider reading a book on SQL, a lot of people don't know how to use SQL properly.
  3. @ Crayon Violent You got what I was doing dead on. I don't care what the value ACTUALLY is, only that it is one of the given values. I use strtolower already, and I don't care if it is TRUE, true, TRuE, or tRuE. As long as it is true or false, another part of my program looks at the actual value. @ nrg_alpha It probably doesn't have to use preg_match, but this is how I set my program up. I have an array similar to this: $this->CONFIGURATION_TYPES = array(); $this->CONFIGURATION_TYPES[0] = array("boolean","/^(true|false|0|1)$/"); $this->CONFIGURATION_TYPES[1] = array("integer","/^[0-9]$/"); //More code here Which makes the code easy to extend. Hopefully you get the idea, I left a lot of code out
  4. The way I have designed my program, and the fact that using preg match was the easiest solution. I am writing an interpreter, and I have an array of datatypes. It contains the name (boolean for example), and the regular expression that is used to verify the data. Thanks for the solution, it works well.
  5. How can I use preg match to see if a string is EQUAL to (Not contains) the string "false" or "true"? I have to use preg match, so that is the only solution I am looking for Thanks
  6. http://www.mikelipkin.com/images/but_about.gif I REALLY need to know the font used here, or something that matches it closely. Thanks
  7. downloading imagick-2.2.1.tgz ... Starting to download imagick-2.2.1.tgz (75,873 bytes) .................done: 75,873 bytes 11 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 ERROR: `phpize' failed Whenever I try to install imagemagick for php I get the above error. I am running XAMPP on Ubuntu 8.10. All I care about is installing imagemagick so PHP can use it, so if anyone knows how to do that, please tell me.
  8. I am no expert with PHP time, but shouldn't it be: $test = gtu("10/20/2008"); echo $test; See the quotes? EDIT: Just tried it, and the quotes fixed it
  9. I would do it by putting the list of variable names in an array. Then use this code: $varArray = array("icufellow","staff","column3","column4","etc"); $varArraySize = count($varArray); echo "<table>"; for ($i = 0; $i < varArraySize;$i++) { echo "<tr>"; for ($f = 1; $f < 32; $f++) { echo "<td> " . $row[$varArray[$i] . $f] . "</td>"; } echo "</tr>"; } echo "</table>"; Don't forget to add your SQL code @DarkWater Thanks for the tip -Brandon
  10. I actually found and a solution thanks. Everything on the server was disabled. NO system commands, shell commands, no zip, tar, etc libs, and the final file had to be just that. One file.
  11. I have 64 bit os, and this was a one time thing. This was the only solution.
  12. How might I go about executing a 2.4 gig php file? It contains the encoded version of an entire directory structure. The script is designed to unpack and recreate this directory structure. No I can't do it any other way. I need to use this file. Any suggestions? I get the following error when trying to run the file directly Warning: Unknown: failed to open stream: Value too large for defined data type in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home2/codespin/public_html/openaurora.org/file.php' (include_path='.:/opt/lampp/lib/php') in Unknown on line 0
  13. Really easy to do. Using Paypal's ipn, have it open a page on your site which extracts an email, creates a random password, and stores it in a database, then emails the user the password. The user needs to enter the url in the download address to be able to access the files. If you need source code, PM me, and I can help you out.
  14. You need to urlencode the slashes in the url. http://ca.php.net/manual/en/function.urlencode.php
  15. login page <?php $PASSWORD = "secret password here"; if (isset($_POST['pass'])) { if ($_POST['pass']) == $PASSWORD) { session_start(); $_SESSION['pass'] = true; header("Location: other_page_path_here.php"); exit(); } else { echo <<<ABC <strong style="color:red;">Looks like you entered the wrong password</strong> <form method="post"> <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> ABC; } } else { echo <<<ABC <form method="post"> <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> ABC; } ?> other page <?php session_start(); if (!isset($_SESSION['pass'])) { //Without a password, redirect to login script header("Location: login_script_path_here.php"); exit(); } ?> //HTML And rest of page here
×
×
  • 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.