Jump to content

anocweb

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

About anocweb

  • Birthday 06/15/1988

Contact Methods

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

Profile Information

  • Gender
    Male
  • Location
    Canada

anocweb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i actually posted a similar problem no answer yet though http://www.phpfreaks.com/forums/index.php/topic,160253.0.html
  2. i apologize. query mysql_query("INSERT INTO product (style, description, category, location, inset, wide) VALUES ('" . $_POST['style'] . "', '" . $_POST['desc'] . "', '" . $_POST['cat'] . "', '$location', '$inset', '" . $_POST['wide'] . "')")or die(mysql_error()); the structure is as follows as well CREATE TABLE `product` ( `key` int(255) unsigned NOT NULL auto_increment, `style` varchar( NOT NULL default '', `description` text, `category` varchar(30) NOT NULL default '', `location` varchar(45) NOT NULL default '', `inset` varchar(45) NOT NULL default '', `wide` char(1) default NULL, PRIMARY KEY (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  3. my website is xhtml 1.1 compliant just needs to have the header changed to application/xhtml+xml and encoding utf-8 the problem occurs when i have: header("Vary: Accept"); if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) header("Content-Type: application/xhtml+xml; charset=utf-8"); else header("Content-Type: text/html; charset=utf-8"); the page messes up. links are below normal version http://www.anocweb.com/index.php content-type changed version http://www.anocweb.com/index_mime.php
  4. are you referring to: $inset = 'cards/' . $_POST['style'] . '.a.jpg'; $location = 'cards/' . $_POST['style'] . '.i.jpg'; if so, it didn't make a difference before. it worked fine for... a couple days and then stopped working could it have anything to do with the mysql ini? if so, i can post it here
  5. that stops them from going further, thanks again. i checked the statistics for my mysql and apparently ~90% of the queries fail... most being inserts. everything else works though. any ideas?
  6. how so? please explain your thoughts.
  7. didnt help persay but does clean it up a bit. thanks. the { and } will cause a parse error though. fixed version: <?php $sql= mysql_connect($connect,$username,$password) or die ('Could not connect: ' . mysql_error()); ?>
  8. i have a website that inserts an item into a database and then uploads the images for a catalog up till recently it worked fine then the owner started having issues. the upload would work but the database wouldn't have the entry in it. but it worked for me. then just shortly after it stopped working for me as well. i dont get any errors from mysql, or php im running apache 2.0.52, php 4.3.9-3.22.5, and mysql 4.1.20-2.RHEL4.1. the mysql variables are in this file: mysql.inc.php <?PHP $servername="localhost"; # enter location of database server $username="marty"; # enter your username for the database $password="*******"; # enter you password for the database $port="3306"; # default is always 3306 $database="content"; # database to connect to ?> the rest of the code is here: card_upload.php <?PHP include('header.inc.php'); include('../mysql.inc.php'); ?> <?php # connect to database $connect = $servername . ":" . $port; $sql = mysql_connect($connect,$username,$password); # check if connection succeeded if (!$sql) {die('Could not connect: ' . mysql_error());} # selects the database mysql_select_db($database, $sql); if ($_POST['step'] == "4") { move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "/var/www/vhosts/tradeart.no-ip.org/httpdocs/cards/" . $_POST['style'] . ".a.jpg"); chmod("/var/www/vhosts/tradeart.no-ip.org/httpdocs/cards/" . $_POST['style'] . ".a.jpg", 0777); echo 'DONE UPLOADING ' . $_POST['style'] . '!'; } elseif ($_POST['step'] == "3") { move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "/var/www/vhosts/tradeart.no-ip.org/httpdocs/cards/" . $_POST['style'] . ".i.jpg"); chmod("/var/www/vhosts/tradeart.no-ip.org/httpdocs/cards/" . $_POST['style'] . ".i.jpg", 0777); echo '<form method="post" enctype="multipart/form-data" url="card_upload.php"><table style="text-align: left; width: 80%;" border="0" cellpadding="2" cellspacing="2"> <tbody><input type="hidden" name="step" value="4"><input type="hidden" name="style" value="' . $_POST['style'] . '"> <tr> <td>Inside Image:</td> <td><input name="uploadFile" type="file"></td> </tr> <tr> <td></td> <td><input value="step 4" type="submit"></form></td> </tr> </tbody> </table>'; } elseif ($_POST['step'] == "2") { $inset = 'cards/' . $_POST['style'] . '.a.jpg'; $location = 'cards/' . $_POST['style'] . '.i.jpg'; $check = mysql_query("INSERT INTO product (style, description, category, location, inset, wide) VALUES ('" . $_POST['style'] . "', '" . $_POST['desc'] . "', '" . $_POST['cat'] . "', '$location', '$inset', '" . $_POST['wide'] . "')")or die(mysql_error()); if ($check == "false") { echo "ERROR PLEASE GO BACK!<br />"; } echo '<form method="post" enctype="multipart/form-data" url="card_upload.php"><table style="text-align: left; width: 80%;" border="0" cellpadding="2" cellspacing="2"> <tbody><input type="hidden" name="step" value="3"><input type="hidden" name="style" value="' . $_POST['style'] . '"> <tr> <td>Outside Image:</td> <td><input name="uploadFile" type="file"></td> </tr> <tr> <td></td> <td><input value="step 3" type="submit"></form></td> </tr> </tbody> </table>'; } else { echo '<table style="text-align: left; width: 80%;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="text-align: right;">Style</td> <td><form method="post" url="card_upload.php"><input type="hidden" name="step" value="2"><input name="style"></td> </tr> <tr> <td style="text-align: right;">Category</td> <td> <select size="1" name="cat">'; $result = mysql_query("SELECT * FROM category"); while($row = mysql_fetch_array($result)) { echo '<option>' . $row['cat'] . '</option>'; } echo '</select> </td> </tr> <tr> <td></td> <td>Horizontal<input checked="checked" name="wide" value="1" type="radio"> Vertical <input name="wide" value="0" type="radio"> </td> </tr> <tr> <td style="text-align: right;">Description</td> <td><textarea cols="35" rows="3" name="desc"></textarea></td> </tr> <tr> <td></td> <td><input value="Step 2" type="submit"></form></td> </tr> </tbody> </table>'; } mysql_close($sql); ?> <?PHP include('footer.inc.php'); ?>
  9. sorry for double posting missed the time to edit by a hair i have also added or die(mysql_error()); to the query, it displays no error
  10. already have that done in the config, but added it to the page anyways to make sure. i don't get any errors and mysql doesn't seem to give much error help, it connects and the query returns false i just don't understand why it would work for a while and then not work at all after that
×
×
  • 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.