Jump to content

Recommended Posts

All,

 

I have three files, one file 'missedvisit.php' is a form. This form is used to POST data to a .csv file. It is on this form that a session is created to obtain the name of the person filling out the form. From there, the person clicks next after obtaining the posted .csv file and goes to a signature capture. This signature capture 'capture.php' uses a flash tool with the PHP POST method to make an image. It calls 'mysignature.php' to process the code for the file. The session_start is called in the capture.php, which POSTS to the mysignature.php, rendering a jpeg. In Firefox and Chrome, I have no issues with the session carrying over the name and naming the jpeg. But in IE7, it just names the file 'mysignature_php'. I was playing around and I noticed that when I post the signature capture in capture.php the 2nd time, the file is named properly, just not the first time. Meaning, if I hit "create signature" it pops up for a file called 'mysignature_php', if I hit cancel, and click "create signature" again, it will render it as a .jpg with the proper file name. Ideas?

 

missedvisit.php

 

 

session_start();
$f = addslashes($_POST['firstname']);
$m = addslashes($_POST['middlename']);
$l = addslashes($_POST['lastname']);
date_default_timezone_set ("America/Chicago");
$d = date("mdY-Hi");
$_SESSION['name'] = $f.$m.$l."_".$d;

 

 

capture.php

 

 

session_start();

 

 

mysignature.php

 

session_start();
//down a few lines
//
$patient = $_SESSION['name'];
$file = $patient.".jpg";
header("Content-type:image/jpeg");
header("Content-Disposition: attachment; filename=$file");
imagejpeg($img, "", 100);

 

 

 

PLEASE HELP?

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/160639-session-problem/
Share on other sites

I was wondering if you have the session _start function before any other header calls or other output to the browser.  Just something I saw in a book I was reading.  Ex. from by book

<?php

session_start();

$_SESSION['hello'] = 'Hello World';

echo $_SESSION['hello'];

?>

 

referencing a variable set on a prior page:

 

<?php

session_start();

echo $_SESSION['hello'];

?>

 

should say Hello World

 

(if I typed it in ok)

Link to comment
https://forums.phpfreaks.com/topic/160639-session-problem/#findComment-848224
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.