Jump to content

interbrowser issues


anocweb

Recommended Posts

ive been designing a website for a card company. lately he has been having issues uploading cards but i have no issues when i try. the only difference is i am on firefox and he is on ie7. could this have any difference?

 

** UPDATE **

i also cant upload now either. im at a complete loss. please help

 

my code is as follows. i apologize if it is messy and uncommented, any questions please ask ill be happy to answer

 

<?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");
       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");
       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'] . "')");
if ($check == "false")
{ echo "ERROR PLEASE GO BACK!"; }
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');
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

if (!$sql) {die('Could not connect: ' . mysql_error());}

<----- this line is not needed

 

 

Try:

<?php
$sql= mysql_connect($connect,$username,$password) or { die ('Could not connect: ' . mysql_error());}?>

 

also make sure your user name and password are correct database wise

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.