Jump to content

rhodesa

Staff Alumni
  • Posts

    5,253
  • Joined

  • Last visited

Everything posted by rhodesa

  1. don't use Date as a column name...it's a reserved word in MySQL
  2. yeah...i did some google searching and it looks like it might not be completely supported in 5.3 i am running PHP 5.2 and have it working with MSSQL
  3. put this as the first line in the script: print_r($_FILES["user_file"]);exit;
  4. Step 1: http://us.php.net/manual/en/mssql.requirements.php Step 2: In your php install dir, in the ext folder, make sure there is php_mssql.dll Step 3: Enabled it in your php.ini file Step 4: Restart webserver and confirm it's working with a phpinfo() page Edit: Looks like there is more info here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
  5. What is the output of: print_r($_FILES["user_file"]); when the file is > 2MB?
  6. no...you can't delegate CPU like that...you could try to slow it down with setTimeout...but that might get messy... why so many loops?
  7. agreed...expensive and dangerous...you may want to look into doing simple substitution instead with str_replace(). or, check out something like Smarty (PHP templating engine)
  8. can you paste all the code? you are probably missing a close brace: }
  9. $receiver = "User2@domain2.com,User3@domain3.com";
  10. this line needs to be changed to: if ($age < 16 && $age > 90) $errorage = true; to make the errors go away...but it doesn't make sense, cus $age can't be less then 16 AND greater 90...do you mean or? if ($age < 16 || $age > 90) $errorage = true;
  11. after the file is uploaded, you have the file and should know the id of the user...now you have a couple of options. you can either keep the filename as is and put the filename in a field in the db for that user...or you can rename the file (my preferred way) to the user's id or username (basically anything unique). this way will prevent any collisions between filenames and makes finding which file is for which user really easy
  12. ok...i see what you want now...and it's a little more complicated: <input type="text" value="click to search..." title="click to search..." onfocus="if(this.title==this.value)this.value='';" onblur="if(this.value=='')this.value=this.title;" />
  13. when you substitute everything in...this is what is being eval'd: $options = "<select id="required1-$id2" name="required1-$id2" disabled='disabled' style='margin-top:5px'> <option>Choose Option</option></select>"; As you can see...your double quotes won't work....you can escape them though: eval("\$options = \"".str_replace('"','\"',$options)."\";");
  14. get rid of the $ in front of the function name: <?php function saywords() { return "hello world"; } $theword = saywords(); ?> <html> <head> </head> <body> <?php echo $theword; ?> </body> </html>
  15. you could have saved yourself a bunch of typing and just used the emoticon:
  16. get rid of the single quotes: $varReturnField = "contact_email"; while ($arrAccVerify = mysql_fetch_array($rsAccVerify)) { $fldReturnField= $arrAccVerify[$varReturnField]; return $fldReturnField; }
  17. can you elaborate? are you thinking like you have one page (we'll call it the parent), and from that page you open a popup (we'll call it the child) and you want the parent/child to be able to communicate together with javascript?
  18. http://us3.php.net/manual/en/mysql.installation.php
  19. try something like this instead: <?php $user = "user"; $password = "password"; $host = "localhost"; $db = "db"; echo "Connecting..."; $conn = mysql_connect($host,$user,$password) or die("Problems connecting: " . mysql_error()); echo "Done<br />"; echo "Selecting DB..."; if(!mysql_select_db($db, $conn)) echo "Failed"; else echo "Done<br />"; mysql_close($conn); ?>
  20. is the name of the column called 'date'? date is a reserved word in MySQL...you should change the name of the column or use backticks: SELECT * FROM $dbtable WHERE `date` < $today ORDER BY date, getin ASC
  21. usually i build the sql statement...so just add the parts you need to the SQL statement as needed edit: but that works too
  22. you are updating EVERYTHING here: // Make the query: $q = "UPDATE users SET first_name='$fn', last_name='$ln', email='$e', pass=SHA1('$np') WHERE user_id=$id LIMIT 1"; you need to omit ", pass=SHA1('$np')" if there is no password submitted
  23. you need a column you can sort on...this can be an auto_increment field or a datetime field...assuming you have an auto_increment field called login_id, it would look like: SELECT * FROM loginTable ORDER BY login_id DESC LIMIT 1
  24. It doesn't set the variables, but it doesn't necessarily stop the mysql statement...where is the rest of the code with the mysql part?
  25. <input type="button" value="click to search" onclick="this.style.display = 'none';" />
×
×
  • 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.