
inspire
Members-
Posts
26 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
inspire's Achievements

Member (2/5)
0
Reputation
-
Friend..Need help. ??? i use php 4.0.5 and apache1.3 in windows xp. i store picture files in database mysql.for the viewing purpose, i echo the file content as link.When i click the link.I get a save as message box.I can save the file in my local computer and view file fine but when i click the open button in "save as message box" , i unable open the file successfully. The error message : the path or file name c:\document and settings\test\local settings\Temporary Internet files\content.IE5\k9mzdera\module4[1].ppt is invalid.please check the path and file name correct. In my php.ini i declare the upload_tmp_dir ="C:/apache/php/uploadtemp/" ; page1.php <? echo " ". "<a href=\"slide-view.php?id1=$id1\"> $name</a>"; ?> --> if i click the link, the download message box appear and when i click open i get error as above. slide-view.php <?php session_start(); mysql_connect("localhost", "root", "root") or die("no connection"); mysql_select_db("gddatab") or die("no database"); if(isset($HTTP_GET_VARS['id1'])) { $id = $HTTP_GET_VARS['id1']; $query = "SELECT cs_name, cs_type, cs_size, cs_content FROM ots_slide WHERE cs_id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($name, $type, $size, $content) = mysql_fetch_array($result); header("Content-length: $size"); header("Content-type: $type"); header("Content-Disposition: attachment; filename=$name"); echo $content; exit; } ?>
-
I have a problem to open the file from the save download message box. in php.ini i already declare : upload_tmp_dir ="C:/apache/ots/uploadtemp/" ; This code work well in apache2 ,php5 and mysql5 , but when i test the code with apache1.3,php4.0.5 i unable to 'open' the content of file from the 'message save dialog box' but i can save the file. <?php session_start(); mysql_connect("localhost", "root", "root") or die("no connection"); mysql_select_db("gddatab") or die("no database"); if(isset($HTTP_GET_VARS['id1'])) { $id = $HTTP_GET_VARS['id1']; $query = "SELECT cs_name, cs_type, cs_size, cs_content FROM ots_slide WHERE cs_id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($name, $type, $size, $content) = mysql_fetch_array($result); header("Content-length: $size"); header("Content-type: $type"); header("Content-Disposition: attachment; filename=$name"); echo $content; exit; } ?>
-
i am using php 4.05 in windows . my problem is i cannot upload image inside the database. anyone can help me solve the problem. ??? <?php mysql_connect("localhost", "root", "") or die("no connection"); mysql_select_db("lab") or die("no database"); if(isset($_POST['upload']) && $HTTP_POST_FILES['userfile']['size'] > 0) { $fileName = $HTTP_POST_FILES['userfile']['name']; $tmpName = $HTTP_POST_FILES['userfile']['tmp_name']; $fileSize = $HTTP_POST_FILES['userfile']['size']; $fileType = $HTTP_POST_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $query = "INSERT INTO upload (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); echo "<script languange = 'Javascript'> alert('File $fileName uploaded'); location.href = 'LMS-upload1.php'; </SCRIPT>"; } ?>
-
my problem is when i login to page2.php its display the session, but when i click the logout image and directed to page1.php, i can login page2.php but the session name not display.because(bcs) after i logout , i directed with page1.php with address bar http://localhost/ots/index.php?id=1,when i try login next time , the session not display page1.php <? session_start(); if(isset($HTTP_POST_VARS['name1'])) $HTTP_SESSION_VARS=$HTTP_POST_VARS['name1']; echo '<script>window.location.href="page2.php"</script>'; ?> <?php if(isset($HTTP_GET_VARS['id'])) Session_destroy(); ?> <html> <head> </head> <body> <form action="<? $PHP_SELF; ?>" method="post"> <input type="text" name="name1" > <input type="submit" value="submit" > </form> </body> </html> page2.php <?php echo $HTTP_SESSION_VARS; <a href(ignore this bcs this create link)="http://localhost/page1.php?id=1"><img src="bg/logout.png" width="60" height="20" border="0" /></a> ?>
-
-
Friend ....i just install the php 5.0 from the installer in my c: drive. But the installation file just have a few files only. It is not have the folder extension. Why this happen.so how to configure the extension in php.ini file. php.ini ; Directory in which the loadable extensions (modules) reside. extension_dir = "./"
-
Session not work-error "Cannot send session cache limiter"
inspire replied to inspire's topic in PHP Coding Help
still cannot solve the problem...set ob_start() at top -
Session not work-error "Cannot send session cache limiter"
inspire posted a topic in PHP Coding Help
Friends ... i have very big problem setting the session in php4.0.5. here the code i tested. page1.php <?php session_start(); echo session_id(); $_SESSION['u_name'] = "test"; ?> page2.php <? session_start(); echo session_id(); echo $_SESSION['u_name']; ?> error message in page2.php Warning: Cannot send session cache limiter - headers already sent (output started at C:\apache\htdocs\ots\page2.php:2) in C:\apache\htdocs\ots\page2.php on line 3 -
even put the session start in page1.php also not solve the problem. ANY SETTING NEED TO DONE IN PHP.INI
-
I am using php 4.0.5 in windows. I have problem passing the session from page1.php to page2.php Anyone can help me solve the problem ??? page1.php <? $_SESSION['u_name'] = "test"; ?> page2.php <? session_start(); echo $_SESSION['u_name']; ?>
-
I have problem upload file. i am using php4.0.5. this upload file code work file in my friend pc which run php5.but in my pc, the page2.php display with empty page and the file not inserted into database. is that any setting need to be done in my php4.0.5 conf file? Pls help page1.php <html> <head> </head> <body bgcolor='#87CEFA'> <table> <tr> <td height="54"><b><font color="3300FF">Add Slide :</font></b> <input name="new_file" type="file" size="25" > <input type="Submit" value=" Upload" name="Submit"> <input type="hidden" name=MAX_FILE_SIZE; value="9000000"> <input type="hidden" name="ref" value="<? echo $id; ?>" ></td> </tr> </table> </form> </body> </html> page2.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $idt = $HTTP_POST_VARS['ref']; mysql_connect("localhost","trainee","123") or die ("Unable to connect server"); mysql_select_db("gddatab") or die("Unable connect database"); if(isset($_POST['Submit'])&& $_FILES['new_file']['size'] > 0) { $fileName = $_FILES['new_file']['name']; $tmpName = $_FILES['new_file']['tmp_name']; $fileSize =$_FILES['new_file']['size']; $fileType =$_FILES['new_file']['type']; $fileopen=fopen($tmpName,'r'); $content=fread($fileopen,fileSize($tmpName)); $content=addslashes($content); fclose($fileopen); if(!get_magic_quotes_gpc()) { $fileName=addslashes($fileName); } $sql="insert into ots_slide values ('','$fileName','$fileType','$fileSize','$content','$idt','jeeva','".date('y-m-d')."') "; $result=mysql_query($sql) or die ("Action Insert Fail"); echo "<script languange = 'Javascript'> alert('File $fileName uploaded'); location.href = 'page1.php'; </SCRIPT>"; } ?> </body> </html>
-
When the file upload button(Submit) clicked , file not saved and new-slideinsert.php display and its not directed to new-course.php. i use uploadtemp folder at php to store the temp file Anyone can help me.... ??? <? session_start(); /* $name=$_SESSION['u_name']; if ($_SESSION['u_name']=='') { echo "<script languange = 'Javascript'> alert('Please Login to access the page'); location.href = 'index.php'; </SCRIPT>"; }*/ ?> <?php echo $idt = $HTTP_POST_VARS['ref']; mysql_connect("localhost","trainee","123") or die ("Unable to connect server"); mysql_select_db("gddatab") or die("Unable connect database"); if(isset($_POST['Submit'])&& $_FILES['new_file']['size'] > 0) { $fileName = $_FILES['new_file']['name']; $tmpName = $_FILES['new_file']['tmp_name']; $fileSize =$_FILES['new_file']['tmp_siz']; $fileType =$_FILES['new_file']['type']; $fileopen=fopen($tmpName,'r'); $content=fread($fileopen,fileSize($tmpName)); $content=addslashes($content); fclose($fileopen); if(!get_magic_quotes_gpc()) { $fileName=addslashes($fileName); } $sql="insert into ots_slide values ('','$fileName','$fileType','$fileSize','$content','$idt','jeeva','".date('y-m-d')."') "; $result=mysql_query($sql) or die ("Action Insert Fail"); echo "<script languange = 'Javascript'> alert('File $fileName uploaded'); location.href = 'new-course.php'; </SCRIPT>"; }