Jump to content

Firefox, Netscape and Opera not accepting my PHP Session?


AJ_V

Recommended Posts

Hi everyone, with help from another PHP Freak'r I have compiled a PHP Upload script including Flash interface to upload files to my hosting. The only problem though is that it will only work with internet explorer? With other browsers, the confirmation link to the file doesn't show at all, it's just blank?

 

I have tried Netscape which will only work in Internet Explorer mode, Firefox doesn't work at all and neither does Opera.

 

The below is what I include on the upload page which is followed by the embeded flash:

 

<?
include "include/session.php";
?>

 

 

This is the contents of "session.php"

 

<?php

session_start();

$_SESSION['SESSION'] = "SESSION";

?>

 

 

This is the "load.php" file which processes the file upload:

 

<?php
session_start();

$storage = 'rds';

$now= date("Y-m-d_Gis_");

$newname = $now.$_FILES['Filedata']['name'];

$uploadfile = "$storage/" . $newname;
//$uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] );

if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
echo( '1 ' . $_FILES['Filedata']['name']);

$_SESSION['filename'] = $storage."/".$newname;
$_SESSION['type'] = $_FILES['Filedata']['type'];
$_SESSION['size'] = $_FILES['Filedata']['size'];

}else{
echo( '0');
}
?>

 

And, finally, this is the code that displays details about the file uploaded - the main thing here, the location of the file:

 

  <?php
echo '<a href="http://vee-media.com/'.$_SESSION['filename'].'">http://www.vee-media.com/'.$_SESSION['filename'].'</a><br>';
echo "Size: " . $_SESSION['size'] . "<br>";
echo "Type: " . $_SESSION['type'] . "<br>";
?>

 

All of this code will work in IE but Opera, Netscape and Firefox just don't like it! They all see that there is a PHP Session but the data seems to disappear? Any ideas anyone?

 

Regards,

AJ.

 

 

 

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.