Script fails to fill MySQL

I have the following scripts install on my xampp server and they work OK. However, when I uploaded the scripts to the webserver they fail and the database does not get filled and nothing echoed to the website. The hosting company say there is an error: addexec.php causes
PHP Fatal error: Cannot use string offset as an array in line 6
Following are the scripts - please help.

[php]
addexe.php

<?php include('config.php'); if (!isset($_FILES['image']['tmp_name'])) { echo ""; }else{ $file=$_FILES['image']['tmp_name']['tmp_email']['tmp_height']['tmp_bust']['tmp_waist']['tmp_hip']['tmp_weight']; $image= addslashes(file_get_contents($_FILES['image']['tmp_name'])); $image_name= addslashes($_FILES['image']['name']); move_uploaded_file($_FILES["image"]["tmp_name"],"photos/" . $_FILES["image"]["name"]); $location="photos/" . $_FILES["image"]["name"]; $caption=$_POST['caption']; $email=$_POST['email']; $height=$_POST['height']; $bust=$_POST['bust']; $waist=$_POST['waist']; $hip=$_POST['hip']; $weight=$_POST['weight']; $save=mysql_query("INSERT INTO photos (location, caption, email, height, bust, waist, hip, weight) VALUES ('$location','$caption','$email','$height', '$bust', '$waist', '$hip', '$weight')"); header("location: index.php"); exit(); } ?>

index.php


PICTURE UPLOAD


Select JPG Image (up to 2MB):

Your Name

Your Email Address or Phone Number:

Your Measurements in Centimeters:
Height (cm):    Bust (cm):    Waist (cm):    Hip (cm):    Weight (KG):

Photo Archieve
if your picture does not load below, then the file size is more than 2MB

<?php include('config.php'); $result = mysql_query("SELECT * FROM photos"); while($row = mysql_fetch_array($result)) { echo '
'; echo '

'; echo '

'.$row['caption'].'

'; echo '
'; } ?> [/php]

The config.php is the database connection script which works.

I was able to solve the problem myself.

Sponsor our Newsletter | Privacy Policy | Terms of Service