Jump to content

DavidAM

Staff Alumni
  • Posts

    1,984
  • Joined

  • Days Won

    10

Everything posted by DavidAM

  1. Did you turn on error_reporting? What is the error you get? If you are not assigning values to all of the columns in the table, then you have to specifically tell the database which columns you are providing: mysql_query("INSERT INTO `athensPhoto` (captionColumnName, pictureColumnName) VALUES ('$caption', '$pic')"); If the ID column is defined as an auto increment column, then this statement should work (use you column names in place of 'captionColumnName' and 'pictureColumnName'). If it does not work, then post the error message so we can help.
  2. Sorry, what am I thinking? INSERT does not allow a WHERE clause. The record will be ADDED to the database. Are you trying to UPDATE an existing row? $sql = "UPDATE pages SET info = '" . $info . "' WHERE page = '".$page."' "; or are you trying to INSERT a new row? $sql = "INSERT INTO pages (info, page) VALUES ('" . $info . "', '" . $page . "');
  3. Did you escape the strings ($info and $page) before you put them in the $sql statement? Add echo '|' . $sql . '|'; just before you execute the query. The vertical bars will help isolate the actual query string. Post what is there and we'll get a better idea of the problem. There may be something in one of the variables ($info or $page) that the server is interpreting.
  4. You say you are trying to execute a perl file, but you are running /usr/bin/php. I'm not sure, but I really don't think PHP will understand PERL. Is that a typo in your question or just running the wrong interpreter?
  5. I've been searching for the solution to this, but can't find any similar problems. I am developing a website using a Linux box at the house. Running Debian 2.6.18-6-486, Apache 2.0.55, PHP 4.4.1. I have worked with PHP Sessions many times and had no problems. For this site, I wanted to use "clean" urls; so I started looking at mod_rewrite. I have it working, but when I combine the two, the server hangs. .htaccess file (in document root) RewriteEngine on #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(trw)/([^/]*)/?$ $1.php?id=$2 [L] trw.php (also in document root) <?php /* Testing mod_rewrite with Sessions */ error_reporting(E_ALL); ob_implicit_flush(true); //echo 'Start ... '; session_start(); echo ' ... started!<BR>'; $_SESSION['ID'] = $_GET['id']; ?> <HTML><HEAD></HEAD><BODY> <H1>Testing mod_rewrite with Sessions</H1><BR> <PRE> <?php echo 'GET: '; print_r($_GET); echo 'SESSION: '; print_r($_SESSION); //session_close_write(); ?> </PRE></BODY> I can request (and receive) this file all day using a standard query string: trw.php?id=2 using any value for the '2'. I can request (and receive) this file once using the "clean" url: trw/2 (again any value for '2'). After getting the page from this "clean url" request, all subsequent requests to the server just hang. The browser never receives anything. If the subsequent request involves a rewrite, the entries appear in the rewrite.log (same entries as for the successful request). In any case, there are no entries in the access_log or error_log for this hung request. The only way to get the server back is to restart using apachectl. I am seeing this behavior in Firefox and IE. It has to be a problem on the server side. Since the problem started I narrowed it down to the session_start function. As I said, sessions work fine without the rewrite; and the page works fine if a query-string is used (thus no rewrite). It is only the combination that seems to be causing the problem. Has anybody ever seen this before, and more importantly, has anyone ever resolved this before?
×
×
  • 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.