Jump to content

rugzo

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by rugzo

  1. Hi all, i have a question about sessions and frames. I have a page which has 2 frames. It has a login system. On every page it starts sessions and checks the access levels. One of the frame is the menu which posts or links and the other one is the main page which gets or shows the links. I have many pages which have all the session starts and login checks on the top. This system works without any problems. Now there is another website which also includes 2 frames. I just want that this webpage should be access over the existing one. There is a link on my first working webpage and if you click that the other one opens (nut in the page, but as another page). I have also 2 frames in this page. But when i am adding the session start and check login into this pages it returns the errors --> ------------ Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\xray\tools\nsn\safi\menu.PHP:1) in C:\xampp\htdocs\xray\functions.php on line 18 Hello ozbay ------------ I cannot understand why this happens, there is nothing diffrent. I am simply adding this <?php require_once ( 'settings.php' ); checkLogin('1 2'); ?> to the top of the pages. The checklogin function is defined in functions.php page. what could be wrong here? thanks in advance...
  2. I tried something --> <script language="javascript"> function isaretle() { form2.box.checked=true ; } </script> ------------- <input type="file" name="dosya" onKeyDown="isaretle()"><br /> <input type="checkbox" name="box"> If i type someting into the input field 'dosya', the code works and the box is checked automatically. But if i click on browse to select a file the box remains uncheck and this is what i need.
  3. Thanks for the quick reply. I tried it but nothing happens when i click on browse and select a file to be uploaded. The box remains unchecked.
  4. Hi all, I have a question about the checkbox. I have an input field in my form. <input type="file" name="box> and i have a checkbox <input type="checkbox" name ="checkbox"> i want that the checkbox is automatically checked when a file for upload is selected. Can anyone help me with that. I tried something like if(isset($_POST['box']);"checkbox value";"1"); but had no success. thanks in advance
  5. Thanks for the quick reply but i don't have a problem with the file upload. If a file is inserted it uploads it without any problem. The only problem is if a file is not inserted, then it returns that the file is not an image. I just want this; it should check if a file is inserted. If the file is not inserted (it can be that the user wants the add his photo after he registered...) it should continue with the rest of the form and not stop with the error that the file is not an image --> if (!in_array($_FILES['dosya']['type'],$tip)) { exit('file is not an image!'); } I also do not want to remove this part since it checks the type of the file. I don't know but i think that this part is not doing its job, it doesnt stop if the field is empty --> if (!empty($_FILES['dosya'])) {
  6. Hi All, i have a problem. I have a script which uploads and rezises the image directly to mysql. I implemented it to my registration form so the users can also upload and update their photo. My only problem is if the photo input field is blank (if the user doesn't want to upload his photo) the script stops with the error that the loaded file is not an image. Here is the script --> include_once ('image.php'); $sinif = new imaj; $tip = array ( "image/pjpeg", "image/jpeg", "image/jpg", "image/gif", "image/png", "image/x-png" ); if (!empty($_FILES['dosya'])) { if (!in_array($_FILES['dosya']['type'],$tip)) { exit('file is not an image!'); } $sinif->img($_FILES['dosya']['tmp_name']); $sinif->resize(130); $sinif->store('tmp/'.$_FILES['dosya']['name']); $icerik = base64_encode(file_get_contents('tmp/'.$_FILES['dosya']['name'])); $dosya_bilgi = getimagesize('tmp/'.$_FILES['dosya']['name']); if ($query !== false) { if (unlink('tmp/'.$_FILES['dosya']['name']) == true) { } } else { if (unlink('tmp/'.$_FILES['dosya']['name']) == true) { } } } Even ther is the --> if (!empty($_FILES['dosya'])) the script doesn't recognize that the field is empty and that it has to continue the next query. I tried it also like -> if(isset($_POST['dosya'])) or if($_POST['dosya']<>'') or if($_POST['dosya'] !=''). I succeeded that with one of the aboves that it recognizes that the dosya field is empty and it also worked to continue with the rest of the query but then i saw that it is also not uploading the file when inserted. Can anyone help??
  7. Hi all, i am trying to include a datepicker into my registration form. On the same page i have signindate, birthday, resigndate... The first date picker works without problem, but in the second line i get an error instead of the picker which says: Fatal error: Cannot redeclare class datePicker in C:\xampp\htdocs\class.datepicker.PHP on line 33 What can i do to redeclare the class.datepicker.php. So far as i understand it can not recall the class.datepicker.php. thanks in advance...
  8. Hi all, i am trying to make a little portal for my work where different users (standart,admin...) will have access. I made the user login system. Now i want to design it. If for example a standart user logs in, he should see not the administrative buttons, links, tables... How can i do this? How can i hide those? thanks in advance...
  9. Ok, i solved the problem after removing the "$" before submit if ($_POST["$submit"])
  10. Does anyone has an idea what the problem might be?
  11. Yes, i changed it overall ---> <? mysql_connect("localhost","root","123*qwe123") or die (mysql_error()); mysql_select_db("kb") or die (mysql_error()); if(!isset($cmd)) { $result = mysql_query("select * from subjects order by id") or die (mysql_error()); while($r=mysql_fetch_array($result)) { $Subject=$r["Subject"]; $Id=$r["Id"]; echo "<a href='edit.php?cmd=edit&Id=$Id'>$Subject - Edit</a>"; echo "<br>"; } } ?> <? if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit") { if (!isset($_POST["submit"])) { $Id = $_GET["Id"]; $sql = "SELECT * FROM subjects WHERE Id=$Id" or die (mysql_error()); $result = mysql_query($sql); $myrow = mysql_fetch_array($result); ?> <form action="edit.php" method="post"> <input type=hidden name="Id" value="<?php echo $myrow["Id"] ?>"> Title:<INPUT TYPE="TEXT" NAME="Subject" VALUE="<?php echo $myrow["Subject"] ?>" SIZE=30><br> <input type="hidden" name="cmd" value="edit"> <input type="submit" name="submit" value="submit"> </form> <? } ?> <? if ($_POST["$submit"]) { $Subject = $_POST["Subject"]; $sql = "UPDATE subjects SET Subject='$Subject' WHERE Id=$Id" or die (mysql_error()); $result = mysql_query($sql); echo "Thank you! Information updated."; } } ?>
  12. Ok i changed it to $result = mysql_query("select * from subjects order by id") or die (mysql_error()); but no errors. Nothing happened.
  13. Thanks for the reply. The table is called subjects. One colum in the table is called Subject.
  14. Hi all, i have a question about updating mysql tables via php. i have a test table like this --> CREATE TABLE IF NOT EXISTS `subjects` ( `Id` int(10) NOT NULL auto_increment, `Subject` text character set latin1 collate latin1_general_ci NOT NULL, `Troubleshoot` text NOT NULL, `Knox` text NOT NULL, `Summary` text NOT NULL, `CTI` text NOT NULL, `GR` text NOT NULL, `Info` text NOT NULL, `Description` text NOT NULL, `Script` text NOT NULL, `TrainingDocuments` text NOT NULL, `PA` text NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; ------------------ The code looks like this--> <? mysql_connect("localhost","root","123*qwe123"); mysql_select_db("kb"); if(!isset($cmd)) { $result = mysql_query("select * from subjects order by id"); while($r=mysql_fetch_array($result)) { $Subject=$r["Subject"]; $Id=$r["Id"]; echo "<a href='edit.php?cmd=edit&Id=$Id'>$Subject - Edit</a>"; echo "<br>"; } } ?> <? if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit") { if (!isset($_POST["submit"])) { $Id = $_GET["Id"]; $sql = "SELECT * FROM subjects WHERE Id=$Id"; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); ?> <form action="edit.php" method="post"> <input type=hidden name="Id" value="<?php echo $myrow["Id"] ?>"> Title:<INPUT TYPE="TEXT" NAME="Subject" VALUE="<?php echo $myrow["Subject"] ?>" SIZE=30><br> <input type="hidden" name="cmd" value="edit"> <input type="submit" name="submit" value="submit"> </form> <? } ?> <? if ($_POST["$submit"]) { $Subject = $_POST["Subject"]; $sql = "UPDATE subjects SET Subject='$Subject' WHERE Id=$Id"; $result = mysql_query($sql); echo "Thank you! Information updated."; } } ?> Everything works fine. But when i click submit it doesn't changes anything in mysql. There is no error. Has anyone an idea what i am missing here. thanks in advance and happy new year
  15. <html> <body bgcolor="#C0C0C0"> <br> <br> <form action="safientry.php" method="post" name="em"> <table align="center" cellspacing="0" cellpadding="0" border="1" bordercolor="#000000"> <tr> <td>Subject</td> <td> <textarea rows="3" cols="100" name="Subject"> </textarea> </td> </tr> <tr> <td>Troubleshoot</td> <td> <textarea rows="30" cols="100" name="Troubleshoot"> </textarea> </td> </tr> <tr> <td>Knox</td> <td> <textarea rows="3" cols="100" name="Knox"> </textarea> </td> </tr> <tr> <td>Summary</td> <td> <textarea rows="3" cols="100" name="Summary"> </textarea> </td> </tr> <tr> <td>CTI</td> <td> <textarea rows="3" cols="100" name="CTI"> </textarea> </td> </tr> <tr> <td>Group</td> <td> <textarea rows="3" cols="100" name="GR"> </textarea> </td> </tr> <tr> <td>Additional Information</td> <td> <textarea rows="3" cols="100" name="Info"> </textarea> </td> </tr> <tr> <td>Description</td> <td> <textarea rows="10" cols="100" name="Description"> </textarea> </td> </tr> <tr> <td>Script</td> <td> <textarea rows="3" cols="100" name="Script"> </textarea> </td> </tr> <tr> <td>Training Documents</td> <td> <textarea rows="3" cols="100" name="TrainingDocuments"> </textarea> </td> </tr> <tr> <td width="30"><input type="button" name="Gonderen" value="submit" size="20" onclick="if(em.Subject.value.length==0) alert('fill in completely'); else em.submit();"> </td> </tr> </table> </form> <?php @mysql_connect ("localhost", "root", "123*qwe123") or die (mysql_error()) ; @mysql_select_db ("kb") or die (mysql_error()) ; $Subject = $_POST["Subject"] ; $Troubleshoot = $_POST["Troubleshoot"] ; $Knox = $_POST["Knox"] ; $Summary = $_POST["Summary"] ; $CTI = $_POST["CTI"] ; $GR = $_POST["GR"] ; $Info = $_POST["Info"] ; $Description = $_POST["Description"] ; $Script = $_POST["Script"] ; $TrainingDocuments = $_POST["TrainingDocuments"] ; if ($Subject <>"") { $sql = "INSERT INTO subjects (Subject, Troubleshoot, Knox, Summary, CTI, GR, Info, Description, Script, TrainingDocuments) values ('$Subject', '$Troubleshoot', '$Knox', '$Summary', '$CTI', '$GR', '$Info', '$Description', '$Script', '$TrainingDocuments') " ; $kayit = mysql_query($sql) ; echo mysql_error() ; } ?> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td>Id</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[0]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Subject</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[1]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Troubleshoot</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[2]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Knox</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[3]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Summary</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[4]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>CTI</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[5]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Group</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[6]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Additional Information</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[7]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Description</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[8]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Script</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[9]; } mysql_free_result($sql); ?></td> </tr> <tr> <td>Training Document</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[10]; } mysql_free_result($sql); ?> </td> </tr> </table> <?php $message = $_REQUEST['Subject'] ; $message .= $_REQUEST['Troubleshoot'] ; $message .= $_REQUEST['Knox'] ; $message .= $_REQUEST['Summary'] ; $message .= $_REQUEST['CTI'] ; $message .= $_REQUEST['GR'] ; $message .= $_REQUEST['Info'] ; $message .= $_REQUEST['Description'] ; $message .= $_REQUEST['Script'] ; $message .= $_REQUEST['TrainingDocuments'] ; $headers .= 'From: safi@d.com' ; mail( "ozgext@d.com", "Project SAFI", $message, $headers ) ; ?> <br> <br> <br> <br> <br> <br> <br> <br> <i><font face="verdana" size="1" > copyright Özgürd</font></i> </body> </html>
  16. Ok thanks, now the mail contains all the information but it still sends an email by the first call of the page. There is always a blank email on the first call??? if i can solve this one everything is solved for my project. thanksss...
  17. Hi all, i am a newbie and have a question about the php mail function. Everytime i call the page it sends the email which i actually want that it will be send after submitting the page. The other problem is that it sends a blank email instead of the values i define. The code looks like --> </td> </tr> <tr> <td>Training Document</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects ORDER BY Id DESC LIMIT 1") ; while ($liste = mysql_fetch_array($sql)) { echo $liste[10]; } mysql_free_result($sql); ?> </td> </tr> </table> <?php $message = $_REQUEST['Subject'] ; $message = $_REQUEST['Troubleshoot'] ; $message = $_REQUEST['Knox'] ; $message = $_REQUEST['Summary'] ; $message = $_REQUEST['CTI'] ; $message = $_REQUEST['GR'] ; $message = $_REQUEST['Info'] ; $message = $_REQUEST['Description'] ; $message = $_REQUEST['Script'] ; $message = $_REQUEST['TrainingDocuments'] ; $headers = 'From: safi@nsn.com' ; mail( "ismet.alkaya@d.com , ozgur.ilhan.ext@d.com , numan.yilmaz.ext@d.com , erkin.yahyaoglu.ext@d.com" , "Project SAFI", $messasge, $headers ) ; ?> how can i prevent that it sends email every time the page is loaded and why is it sending a blank email istead of the variables i've choosen. thanks for your help best regards, (edited to add tags)
  18. Hi all, i get the error message below when i submit a form to mysql ---> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group, Info, Description, Script, TrainingDocuments) values (' ', ' ', ' ', ' at line 1 I don't know which of the values is causing this or even if it is one of them. My table is ---> CREATE TABLE IF NOT EXISTS `subjects` ( `Id` int(10) NOT NULL auto_increment, `Subject` text NOT NULL, `Troubleshoot` text NOT NULL, `Knox` text NOT NULL, `Summary` text NOT NULL, `CTI` text NOT NULL, `Group` text NOT NULL, `Info` text NOT NULL, `Description` text NOT NULL, `Script` text NOT NULL, `TrainingDocuments` text NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; and my form looks like ---> <?php @mysql_connect ("localhost", "root", "123*qwe123") or die (mysql_error()) ; @mysql_select_db ("kb") or die (mysql_error()) ; $Subject = $_POST["Subject"] ; $Troubleshoot = $_POST["Troubleshoot"] ; $Knox = $_POST["Knox"] ; $Summary = $_POST["Summary"] ; $CTI = $_POST["CTI"] ; $Group = $_POST["Group"] ; $Info = $_POST["Info"] ; $Description = $_POST["Description"] ; $Script = $_POST["Script"] ; $TrainingDocuments = $_POST["TrainingDocuments"] ; if ($Subject <>"") { $sql = "INSERT INTO subjects (Subject, Troubleshoot, Knox, Summary, CTI, Group, Info, Description, Script, TrainingDocuments) values ('$Subject', '$Troubleshoot', '$Knox', '$Summary', '$CTI', '$Group', '$Info', '$Description', '$Script', '$TrainingDocuments') " ; $kayit = mysql_query($sql) ; echo mysql_error() ; } ?> Has someone a Idea. Many thanks...
  19. Thanks for the quick replies... Hi shadiadiph, thanks for the suggestion, but as you said it would only post corina. Hi revraz, i am a beginner who is trying to learn from e-books and forums by himself. Thats why i wrote here in hope for help. You should not criticise people but help if you are a member in such a forum like this. This only demoralizes people who are searching for help. I think this is the right topic "PHP Help". And Hi KingPhilip, your suggestion was exactly what i needed, i tried it and it worked fine. Your the king Thank you... Problem Solved
  20. Hi all, i have a question where i am stucked. We want to build a database for our work. There will be a html and a php page. In the html page you will have a list of subjects. If you click on the subject it should post it to the php page where the result from mysql is shown. But i have a problem by building the variable. I will give a simple example. the html page is ---> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /> <script type="text/javascript" language="javascript1.2"> function goster_gizle(x) { if ( document.getElementById(x).style.display == '' ) { document.getElementById(x).style.display = 'none' } else { document.getElementById(x).style.display = '' } } </script> <style type="text/css"> .ust_menu{ width: 150px; padding: 3px; border:1px solid #ccc; } .ust_menu a{ text-decoration: none } .alt_menu { padding-left: 10px; } </style> </head> <body> <form action="result.php" method="post"> <div class="ust_menu"><a href="javascript:goster_gizle('alt_menu_1')">VPN</a> <div class="alt_menu" id="alt_menu_1" style="display:none"> <a href="javascript:goster_gizle('alt_menu_2')">Corina</a> <br> <div class="alt_menu" id="alt_menu_2" style="display:none"> [b]<input type="submit" name="corina_account_request" value="corina account request">[/b] </div> <a href="javascript:goster_gizle('alt_menu_3')">Nira</a> <br> <div class="alt_menu" id="alt_menu_3" style="display:none"> Konu 2-2</div> <a href="javascript:goster_gizle('alt_menu_4')">RLA</a> <br> <div class="alt_menu" id="alt_menu_4" style="display:none"> Konu 3-3</div> <a href="javascript:goster_gizle('alt_menu_5')">Cisco</a> <br> <div class="alt_menu" id="alt_menu_5" style="display:none"> <a href="1.htm">Konu 4-4 </a></div> <a href="javascript:goster_gizle('alt_menu_6')">CheckPoint</a> <div class="alt_menu" id="alt_menu_6" style="display:none"> <a href="1.htm">Konu 4-4</a></div> </div> </div> I marked the important thing here with green. If for example the subject "corina account request" is clicked it should post the value "corina_account_request" to the php page. The php page should get this and put it into the sql query. here is the php page -->>> <?php @mysql_connect ("localhost","root","123*qwe123") or die ("nix sql") ; @mysql_select_db ("kb") or die ("nix db") ; $search = $_POST["name"] ?> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td>Id</td> <td><?php $sql = mysql_query ("SELECT * FROM subjects where Subject = '$search' ") ; while ($liste = mysql_fetch_array($sql)) { echo "$liste[0]"; ?><? } mysql_free_result($sql); echo mysql_error() ; ?></td> </tr> but off course it doesn't work. The important thing for me is to get the value into this variable--> $search = $_POST["name"] it should basicly take the subject from the html page (there will be many) and put it into the query. Can please someone help me. thanks very much
  21. rugzo

    Mysql Backup

    In case the system should crash i want to be able to recovery all the databases and tables with all the settings and storages after a new mysql installation...
  22. rugzo

    Mysql Backup

    The databases which i created in mysql...
  23. rugzo

    Mysql Backup

    Hi all, what is the best way to make autobacks for mysql. I have for example a software called KLS Backup 2008 which can make backups of files and folder but i don't exactly know which folders i have to backup since i am using xampp. Or is there a better way or a software which i can use. Thanks very much...
×
×
  • 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.