
inspire
Members-
Posts
26 -
Joined
-
Last visited
Never
Everything posted by inspire
-
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>"; }
-
Anyone know how to solve the error for "cannot modify header information" ???
-
why the open or download message box not appear and the unknown text display when click the link. how to solve this header already send problem. anyone know about it....pls help slide-view.php <?php mysql_connect("localhost", "root", "") or die("no connection"); mysql_select_db("gddatab") or die("no database"); if(isset($_GET['id1'])) { $id= $_GET['id1']; echo $id; $query = "SELECT t_name, t_type, t_size, t_content FROM ots_slide WHERE t_id = '$id1'"; $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 "<meta http-equiv=\"refresh\" \"Content-length: $size\" >"; echo "<meta http-equiv=\"refresh\" \"Content-type: $type\" >"; echo "<meta http-equiv=\"refresh\" \"Content-Disposition: attachment; filename=$name\" >"; echo $content; exit; } ?> output Warning: Cannot modify header information - headers already sent by (output started at C:\server\www\OTS\slide-view.php:11) in C:\server\www\OTS\slide-view.php on line 18 Warning: Cannot modify header information - headers already sent by (output started at C:\server\www\OTS\slide-view.php:11) in C:\server\www\OTS\slide-view.php on line 19 Warning: Cannot modify header information - headers already sent by (output started at C:\server\www\OTS\slide-view.php:11) in C:\server\www\OTS\slide-view.php on line 20 GIF89a÷îîîlW{mX{mX|çæèr^€æåçÜÙÞt`‚–ˆ ëêëèçéêéꪟ²éèéoZ}ĽÉììì°¦·nY|nY}ÏÊÓ¸°¿p[~˜Š¢ÝÚß“…žÎÉÒííîs_íííììí}˜¿¸ÅÉÃÎÍÈчv“‚qØÕÛàÞâåäæÌÆÐ~l‹¼´Â§›¯Ú×Ü„sáßãÛ×ÝÞÜà‘‚›£—¬¬¢´ž‘§Ÿ“©ÑÍÕÐÌÔwc„ÓÏ×™Œ£ãá亲ÀÖÒØÒÎÖ¥™®›¤|j‰ØÔÚµ¬»®£µ€›¢•ª×ÓÙo»ǩ±ßÝáåãæq]€œ¦äã徶Ãyf†•†ŸÈÂÌ’ƒ‹{—o[~áßâÁ¹ÆÕÐ×±¨¸ÊÅγªºÇÀËâàäãâåÅ¿ÊŽ™ÙÖÜq\·®½ÂºÇuaƒ½µÂêêë{i‰xe†äâåÆÀË®¤¶›ÔÐן’¨ßÜànŒ¦¨œ°Œ|—‰x”ëëìvb„¦š®—‰¡¬¡³»³Áp\¡•ª´«»š¤}kŠàÝáÌÇÐvc„ÚÖÜzhˆÞÛà…u’²©¹¶¼Ã¼Èubƒééꤘ¬£–«©ž±’ƒœÖÒÙšŒ¤œ¥ÈÂͦ›®ÙÕÛÉÃÍÆ¿ÊšƒrÑÌÔ…t‘·¯¾¨°µ¬¼« ³€nÇÁ̶½²¨¹§ˆx”€o»²À´ª»ˆw“Šy•ËÆÏ¥™¿·Ä¤˜¹±ÀÁºÆ€š¯¥¶ÛØÝÒÍÕÊÄΊz–×ÓÚ±§¸˜‹¢¡”©³©º “©zg‡¾¶Ä½µÃ|i‰ž’¨« ²ËÅφu’“„™‹£›Ž¥‰y•ÐËÓxe…ÕÑØ£µÏÊÒÀ¸ÅÓÏÖ¢–«¸¯¾§œ¯âà㢴¼³ÁmŒ‡v’‘‚œÀ¹Åyf‡¹°¿¯¥·‚pŽwd…”†Ÿ”…žÅ¾É{hˆ•‡ !ù,ÿH° Áƒ*,( ¡Ã‡Hœ8q‚E‹2f|À‘ã•B^ð㇌I'( ¨\Ù¡e 0až9Ó¨Qž<… åخٚ5R‚vvèP95j† Y*HŠ§ÙæÌ•*‰Up%²rrÁÕS¢DÇ´‘Ë Õ;ËZå²ÂÖŽ pAˆ™»‰–‘»oÞÈØ»MR•¿È4Ö0NÜ”Ãæ(V¼g†Çx%ÛA™R @A2+«ô¤3 :§jˆ&'ŽÓ¿zýùs¤õ4H3b?zëÛzô\bÁ»Z: –Ô xñb¢øð¡ÁüÚ³"Ðݸ©õM‚u뻶h7¥H‘¯.àWÿD¤|¨E‹J•Yÿ‰š…÷¼ÉêA_UŸ>ØVèGƒFX”ÿÁÀ€!DÃMÎb†J4È#D!9aT¨Imx¡!)TthI&"„(.\”hŒ+)¤H!#´8Â0nM4VÀ 8vrÃŽ·üà£4: ZéŒHN‚Ä’º ᤠPb2Æ”†Ò•0diË\v™Á— ‚H dÊ! h2È lbáæ pZóÅœ<Ô Æl°ÅžMô‰ÂŸ*(„JÀˆ"êÀ¢‹:âBšF TZ)‑xD ©¦tú zÀÁ¨`ꩨ¦ªêª¬¶êê«°Æ*무Öjë¸æªë®¼öêë¯ÀÞ;
-
Friend....I am using php version 4.0.5 in windows . My problem is i cannot pass the session from the page1.php to page2.php. note: i am using $HTTP_SESSION_VARS because the php ver <4.1 not support $_SESSION. So how to solve the problem.....pls help page1.php <?php session_start(); ?> <? //session_register('xyz'); $HTTP_SESSION_VARS['name']="xyz"; ?> <html> <head> <form action="page2.php" method="post"> <body> <input type="Submit" name="login" value="login"> <input type="input" name="login" > </head> </form> </body></html> page2.php <?php session_start(); //echo $HTTP_SESSION_VARS['name']; $name=$HTTP_POST_VARS['login']; //echo $login; ?>
-
ok...the method is.. - define page1.php with form tags as <form action="page2.php" method="post"> - inside the page1.php add some hidden or text fields and a submit button( input type='Submit') - on page2.php define $new=$_POST['x']......x=the textbox or hidden field value -echo the $new; .... you will see the posting there.
-
Friend....I am using php version 4.0.5 in windows . My problem is i cannot pass the session from the page1.php to page2.php. note: i am using $HTTP_SESSION_VARS because the php ver <4.1 not support $_SESSION. So how to solve the problem.....pls help ??? :'( page1.php <?php session_start(); ?> <? //session_register('xyz'); $HTTP_SESSION_VARS['name']="xyz"; ?> <html> <head> <form action="page2.php" method="post"> <body> <input type="Submit" name="login" value="login"> <input type="input" name="login" > </head> </form> </body></html> page2.php <?php session_start(); //echo $HTTP_SESSION_VARS['name']; $name=$HTTP_POST_VARS['login']; //echo $login; ?>
-
The session still not display
-
when i pass the session , the sesion variable is not display in new-course.php here the code.....pls help i am using php 4.0 page index.php <? session_start(); mysql_connect("localhost","trainee","123") or die ("Unable to connect to the server"); mysql_select_db("gddatab"); if(isset($HTTP_POST_VARS['usernameh'])) { $uname=$HTTP_POST_VARS['usernameh']; $upass=$HTTP_POST_VARS['passwordh']; $sql=("select * from user where s_username ='$uname' and s_password ='$upass'"); $result=mysql_query($sql); $recordset=mysql_fetch_assoc($result); $recordset_count=mysql_num_rows($result); if($recordset_count==1) { $_SESSION['name'] = $recordset['s_name']; echo $_SESSION['name']; echo '<script>window.location.href=\'new-course.php\'</script>'; } else { session_destroy(); $failed=true; } } new-course.php <? session_start(); ?> <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title></title> </head> <body > <? echo $_SESSION['name']; ?> </body> </html>
-
still the sesion variable is not display in new-course.php ???