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
https://forums.phpfreaks.com/topic/70023-interbrowser-issues/
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
https://forums.phpfreaks.com/topic/70023-interbrowser-issues/#findComment-352086
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
https://forums.phpfreaks.com/topic/70023-interbrowser-issues/#findComment-352111
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
https://forums.phpfreaks.com/topic/70023-interbrowser-issues/#findComment-352152
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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