Jump to content

BlueSkyIS

Members
  • Posts

    4,268
  • Joined

  • Last visited

Everything posted by BlueSkyIS

  1. already stated that image is stored in the database and needs to pull image from database and send directly to browser, thus no possibility for a simple image link to a file.
  2. i might not understand the complexity of the problem, but is file_get_contents() not an option? if possible, i would loop over each url and use file_get_contents() to get the page content.
  3. i suspect it's the line-endings. you can try \n and/or \r\n instead. but i really suggest that you try phpexcel. it is a very easy-to-use class that makes real Excel files (not just tab-delimited as in your code). you can add worksheets, cell styles, all kinds of stuff if you need to. http://phpexcel.codeplex.com/
  4. make sure they are set before referencing them, for instance: if (isset($_POST['submit'])) { // etc.
  5. any errors reported? when you View Source, is there no content at all or any errors at the bottom?
  6. I suspect it is php configuration of max_execution_time. you might get around this using set_time_limit() at the top of your code: http://php.net/manual/en/function.set-time-limit.php
  7. a. $import="UPDATE TABLE2 SET marketPrice='{$arrayValue[71]}' WHERE typeID='$typeID'"; b. are you sure there is a $arrayValue[71]? i would use var_dump($arrayValue) and/or print_r($arrayValue) to see what's in it and/or directly echo $arrayValue[71] to see if the value is set.
  8. $_GET and $_POST arrays: looks okay to me, but we can't tell what is going to be done with $get/$postVars and we don't know what clean() function does. do you have any specific questions or concerns?
  9. die('Error: ' . mysql_error()); this causes the code to stop and display mysql_error(). you should remove that line and get mysql_errno() to check for error number 1062, which is duplicate key
  10. To check to see if there was an error: To check existing fields: example: $inputval = 'something'; // Does this value exist in field somefield in table sometable? $sql = "SELECT id FROM sometable WHERE somefield = '".mysql_real_escape_string($inputval)."'"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_numrows($result) > 0) { // This value already exists, so show error } else { // This value does not already exist }
  11. I assume that you know how to run a SQL query in PHP, as the question pertains to a problem you see when you do that. So which part do you have questions on, the PHP or the SQL syntax?
  12. I would use a SQL select statement to check if there is already a record with the matching value. if the number of results returned == 0, then there is no existing match and everything is okay. if the number of results > 0, there is a match and the user should get the warning.
  13. alternatively, don't let the error happen. check to see if there is a duplicate and tell the user if there is one.
  14. upload the files to the server and move them into the new directory. the first link in my post provides many tutorials on handling file uploads. here is the first one: http://www.tizag.com/phpT/fileupload.php
  15. do you just need to know how to handle file uploads? http://www.google.com/search?client=safari&rls=en&q=php+file+upload&ie=UTF-8&oe=UTF-8 http://www.google.com/search?client=safari&rls=en&q=php+image+upload&ie=UTF-8&oe=UTF-8
  16. your query is probably failing. you should check. $sql = "UPDATE tab SET about='$_POST[about]',contact='$_POST[contact]',present='$_POST[present]',inter='$_POST[inter]',high='$_POST[high]',books='$_POST[books]',sports='$_POST[sports]',pastime='$_POST[pastime]',interests='$_POST[interest]' WHERE name='$_SESSION[name]'"; mysql_query($sql) or die(mysql_error() . " IN $sql"); echo "Successfully uploaded the data.<a href='index.php'>Click here</a> to return back.";
  17. else if (what?) can you just use else? if($a > $b) { echo "A is bigger than B"; } else { fwrite($z, $b); }
  18. what mjdamato described would be a good alternative.
  19. you shouldn't store images in the database. you should save them as a regular file and store the image path/name in the database. but, anyway... this should be <input type="file" name="image1" />
  20. many people here are skilled at PHP. but no one has the ability to look at code, parse the code and run it in his/her head. learning PHP involves making mistakes, fixing them, making more mistakes, fixing those mistakes, etc., ad infinitum. if you don't try anything, you will never learn.
  21. 1. header error means there was output before you called header(). output can be anything: HTML, open space, anything. You can't output anything to browser before header() 2. this is invalid and i would expect a fatal parse error: $db_select = mysqli_select_db($connect, wefdewfdswe");
  22. either split the js into different files or use PHP if/then around the js functions and load them as needed. the second option will require that the JS is in the .php file OR the .js file is changed to a .php file so that it is executed by the server before being sent to the browser.
  23. if the wrong email or password is entered, $output is not set. you'll need to define $output somewhere before trying to echo it. i suggest that you indent your code so the logic is more apparent.
  24. i suggest that you store the image as a regular file on the server (not in a database) and store the file name and/or path in the database.
×
×
  • 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.