Jump to content

dsp77

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by dsp77

  1. Hello ppl, I have this website link http://www.somesite.com/anotherpage/yetotherpage.html what i want to make is using preg_replace that the final result will be www.somesite.com
  2. i have figured how to change the input type from password to text but i could not make it back from password to text with the same button. <input type="password" name="myElement" id="pass" value="some text" /> <input name="show password" type="button" onclick="document.getElementById('pass').type = 'text';" /> any advise please
  3. Hello, I have created a dropdown menu on the left side, the problem is that i cannot make it to stay open when the current page is opened, you can see it in action at: http://www.euraxess.ro/cms/ I'm out of ideas:( please help
  4. i have this menu item for wordpress everything works except that i want to keep the list open when a page (current page) is selected and i cannot make it, any ideas? The menu below is what wordpress and java generates. <script type="text/javascript"> var menuids=["menu-test"] //Enter id(s) of each Side Bar Menu's main UL, separated by commas function initsidebarmenu(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle" if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item else //else if this is a sub level submenu (ul) ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.display="block" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.display="none" } } for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars ultags[t].style.visibility="visible" ultags[t].style.display="none" } } } if (window.addEventListener) window.addEventListener("load", initsidebarmenu, false) else if (window.attachEvent) window.attachEvent("onload", initsidebarmenu) </script> <style type="text/css"> /* MENU */ #menu-header .menu-item { background-image:url("images/homeBg.jpg"); background-position:left top; background-repeat:no-repeat; /*height:26px;*/ margin:0 0 2px 10px; padding:0; width:160px; } #menu-header .menu-item a { color:#9495A0; display:block; font-family:Arial, Helvetica, sans-serif; font-size:11px; font-style:normal; font-weight:bold; height:26px; line-height:26px; margin:0; padding:0; text-decoration:none; width:160px; } #menu-header ul.sub-menu { list-style:none outside none; margin:4px 0 4px 10px; padding:0; } #menu-header ul.sub-menu li { /*height:18px;*/ line-height:18px; margin:0 0 2px; padding:0; width:160px; } #menu-header ul.sub-menu a { font-family:Arial, Helvetica, sans-serif; font-size:11px; font-style:normal; font-weight:bold; color:#6F6F6F; text-decoration:none; display:block; margin:0px; padding:0px; width:160px; line-height:18px; height:18px; padding-left:14px; background-image:url("images/menuBg.gif"); background-repeat:no-repeat; background-position:top left; } #menu-header ul.sub-menu a:hover { font-family:Arial, Helvetica, sans-serif; font-size:11px; font-style:normal; font-weight:bold; color:#FFFFFF; text-decoration:none; display:block; margin:0px; padding:0px; padding-left:26px; width:140px; line-height:18px; height:18px; background-image:url("images/selectedMenuBg.gif"); background-repeat:no-repeat; background-position:top left; } #menu-header ul.sub-menu li.selected { width:160px; line-height:18px; height:18px; margin:0px; padding:0px; margin-bottom:2px; } #menu-header ul.sub-menu li.selected a { font-family:Arial, Helvetica, sans-serif; font-size:11px; font-style:normal; font-weight:bold; color:#FFFFFF; text-decoration:none; display:block; margin:0px; padding:0px; width:160px; line-height:18px; height:18px; padding-left:14px; background-image:url("images/selectedMenuBg.gif"); background-repeat:no-repeat; background-position:top left; } </style> <div class="menu-test-container" id="menu-header"><ul class="menu" id="menu-test"><li class="menu-item menu-item-type-post_type current-menu-item page_item page-item-2 current_page_item menu-item-7" id="menu-item-7"><a href="http://127.0.0.1/euraxess/" title="Acasa">Acasa</a></li> <li class="menu-item menu-item-type-post_type menu-item-19" id="menu-item-19"><a href="http://127.0.0.1/euraxess/?page_id=4">Ce este EURAXESS?</a></li> <li class="menu-item menu-item-type-post_type menu-item-18" id="menu-item-18"><a href="http://127.0.0.1/euraxess/?page_id=10" class="subfolderstyle">Servicii EURAXESS</a> <ul class="sub-menu" style="left: 160px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-26" id="menu-item-26"><a href="http://127.0.0.1/euraxess/?page_id=20">Centre de servicii</a></li> <li class="menu-item menu-item-type-post_type menu-item-24" id="menu-item-24"><a href="http://127.0.0.1/euraxess/?page_id=22">Contact / Asistenta</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-94" id="menu-item-94"><a href="http://127.0.0.1/euraxess/?page_id=27" class="subfolderstyle">Cercetatori straini</a> <ul class="sub-menu" style="left: 160px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-95" id="menu-item-95"><a href="http://127.0.0.1/euraxess/?page_id=29" class="subfolderstyle">Conditii de intrare</a> <ul class="sub-menu" style="left: 174px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-97" id="menu-item-97"><a href="http://127.0.0.1/euraxess/?page_id=31">Viza si permis de sedere</a></li> <li class="menu-item menu-item-type-post_type menu-item-96" id="menu-item-96"><a href="http://127.0.0.1/euraxess/?page_id=33">Permis de munca</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-79" id="menu-item-79"><a href="http://127.0.0.1/euraxess/?page_id=35" class="subfolderstyle">Acomodare</a> <ul class="sub-menu" style="left: 174px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-81" id="menu-item-81"><a href="http://127.0.0.1/euraxess/?page_id=37">Locuri de cazare</a></li> <li class="menu-item menu-item-type-post_type menu-item-80" id="menu-item-80"><a href="http://127.0.0.1/euraxess/?page_id=39">Cursuri lingvistice</a></li> <li class="menu-item menu-item-type-post_type menu-item-98" id="menu-item-98"><a href="http://127.0.0.1/euraxess/?page_id=41">Sanatate si centre medicale</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-99" id="menu-item-99"><a href="http://127.0.0.1/euraxess/?page_id=43" class="subfolderstyle">Munca</a> <ul class="sub-menu" style="left: 174px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-102" id="menu-item-102"><a href="http://127.0.0.1/euraxess/?page_id=45">Securitate sociala</a></li> <li class="menu-item menu-item-type-post_type menu-item-100" id="menu-item-100"><a href="http://127.0.0.1/euraxess/?page_id=47">Impozitare</a></li> <li class="menu-item menu-item-type-post_type menu-item-101" id="menu-item-101"><a href="http://127.0.0.1/euraxess/?page_id=49">Proprietate intelectuala</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-88" id="menu-item-88"><a href="http://127.0.0.1/euraxess/?page_id=51" class="subfolderstyle">Cercetare</a> <ul class="sub-menu" style="left: 174px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-89" id="menu-item-89"><a href="http://127.0.0.1/euraxess/?page_id=53">Cercetarea in Romania</a></li> <li class="menu-item menu-item-type-post_type menu-item-90" id="menu-item-90"><a href="http://127.0.0.1/euraxess/?page_id=55">Invatamant superior</a></li> <li class="menu-item menu-item-type-post_type menu-item-87" id="menu-item-87"><a href="http://127.0.0.1/euraxess/?page_id=57">Calificari</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-93" id="menu-item-93"><a href="http://127.0.0.1/euraxess/?page_id=59" class="subfolderstyle">Viata cotidiana / de familie</a> <ul class="sub-menu" style="left: 174px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-92" id="menu-item-92"><a href="http://127.0.0.1/euraxess/?page_id=61">Viata cotidiana</a></li> <li class="menu-item menu-item-type-post_type menu-item-91" id="menu-item-91"><a href="http://127.0.0.1/euraxess/?page_id=63">Ingrijirea copiilor / scoala</a></li> </ul> </li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-105" id="menu-item-105"><a href="http://127.0.0.1/euraxess/?page_id=65" class="subfolderstyle">Cercetatori autohtoni</a> <ul class="sub-menu" style="left: 160px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-106" id="menu-item-106"><a href="http://127.0.0.1/euraxess/?page_id=67">Burse si granturi</a></li> <li class="menu-item menu-item-type-post_type menu-item-107" id="menu-item-107"><a href="http://127.0.0.1/euraxess/?page_id=69">Informatii practice</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-108" id="menu-item-108"><a href="http://127.0.0.1/euraxess/?page_id=71" class="subfolderstyle">Finantare pentru cercetare</a> <ul class="sub-menu" style="left: 160px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-110" id="menu-item-110"><a href="http://127.0.0.1/euraxess/?page_id=73">Pentru Romania</a></li> <li class="menu-item menu-item-type-post_type menu-item-109" id="menu-item-109"><a href="http://127.0.0.1/euraxess/?page_id=75">In Europa</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-127" id="menu-item-127"><a href="http://127.0.0.1/euraxess/?page_id=116" class="subfolderstyle">Locuri de munca</a> <ul class="sub-menu" style="left: 160px; visibility: visible; display: none;"> <li class="menu-item menu-item-type-post_type menu-item-126" id="menu-item-126"><a href="http://127.0.0.1/euraxess/?page_id=118">In Romania</a></li> <li class="menu-item menu-item-type-post_type menu-item-125" id="menu-item-125"><a href="http://127.0.0.1/euraxess/?page_id=120">In Europa</a></li> <li class="menu-item menu-item-type-post_type menu-item-124" id="menu-item-124"><a href="http://127.0.0.1/euraxess/?page_id=122">Editare CV / Postare joburi</a></li> </ul> </li> <li class="menu-item menu-item-type-post_type menu-item-111" id="menu-item-111"><a href="http://127.0.0.1/euraxess/?page_id=77">Drepturi EURAXESS</a></li> </ul></div>
  5. Hello, i have an upload form witch i cannot upload pdf it does not recognize the mine pdf type, any help please. here is the code $target_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/upload/'; $target = "upload/".$HTTP_POST_FILES['uploadedfile']['name']; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $fileSize = $_FILES['uploadedfile']['size']; $fileType = $_FILES['uploadedfile']['type']; if ($_FILES['uploadedfile']['size'] > 0) { if (($_FILES["uploadedfile"]["type"] == "image/gif") || ($_FILES["uploadedfile"]["type"] == "image/jpeg") || ($_FILES["uploadedfile"]["type"] == "image/png" ) || ($_FILES["uploadedfile"]["type"] == "application/msword" ) || ($_FILES["uploadedfile"]["type"] == "application/pdf" ) && ($_FILES["uploadedfile"]["size"] < 512000)) { move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path); $query_upload="INSERT INTO upload (upload, chair, id_domeniu, email_1) VALUES ('" . $target . $_FILES['uploadedfile']['name'] . "', '3', '$id_domeniu', '".$_GET['email_1']."')"; $query_upload="UPDATE domenii SET upload='" . $target . $_FILES['uploadedfile']['name'] . "' WHERE email_1='".$email_1."'"; mysql_query($query_upload) or die(mysql_error()); } else { echo "<script language='javascript'>alert('Programul uploadat trebuie sa fie PDF, DOC, JPEG si mai mic de 500 kilobytes.');window.location = 'javascript:history.go(-1)';</script >"; exit(); } }
  6. it worked thank you so much
  7. yes the record appears two times and i want to remove the one that repeats that doesn't have the selected statement. As you can see its two times the first one is the good one that needs to remain and the second removed but its generated by while statement. <option value="1" selected="selected">Stiinte Sociale</option> <option value="1">Stiinte Sociale</option>
  8. I don't know how to make the select box to show the selected item that user picked at sign up (this is made in the first query) without showing all "domenii" (second query) including the picked one. Here is the select box output for a better understanding. The domain Stiinte Sociale appears 2 times. <select name="id_domeniu"><option value="1" selected="selected">Stiinte Sociale</option><option value="1">Stiinte Sociale</option><option value="2">NanoBioSystems</option></select> <?php require_once('config.php'); $query="SELECT domenii.nume, domenii.id FROM domenii INNER JOIN inregistrari ON domenii.email_1=inregistrari.email_1"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $id_ales=$row['id']; $nume_ales=$row['nume']; } $select_box="SELECT nume,id FROM domenii"; $result2 = mysql_query ($select_box); echo "<select name=id_domeniu>"; echo "<option selected='selected' value='$id_ales'>$nume_ales</option>"; while($nt=mysql_fetch_array($result2)){ echo "<option value=$nt[id]>$nt[nume]</option>"; } echo "</select>"; ?>
  9. when i submit the form it only checks for $hasErrorNume if its valid and goes on but if the rest $hasErrorPrenume $hasErrorOrganizatie etc are empty it still goes on if i add if(!isset($hasErrorNume,$hasErrorPrenume,$hasErrorOrganizatie)) it still check only for the firstone and i want to check for all errors
  10. //If the form is submitted if(isset($_POST['submit'])) { //Check to make sure that the nume field is not empty if(trim($_POST['nume']) == '') { $hasErrorNume = true; } else { $nume = trim($_POST['nume']); } //Check to make sure that the prenume field is not empty if(trim($_POST['prenume']) == '') { $hasErrorPrenume = true; } else { $prenume = trim($_POST['prenume']); } //Check to make sure that the organizatie field is not empty if(trim($_POST['organizatie']) == '') { $hasErrorOrganizatie = true; } else { $organizatie = trim($_POST['organizatie']); } //Check to make sure sure that a valid email address is submitted if(trim($_POST['email_1']) == '') { $hasErrorEmail_1 = true; } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email_1']))) { $hasErrorEmail_1_e = true; } else { $email = trim($_POST['email_1']); } //If there is no error, send the email if(!isset($hasErrorNume)) { $emailTo = 'youremail@yoursite.com'; //Put your own email address here $body = "Name: $name \n\nEmail: $email \n\nSubject: $nume \n\nComments:\n $prenume"; $headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email_1; mail($emailTo, $subject, $body, $headers); $emailSent = true; } }
  11. i have a form that i validate by: if(isset($hasErrorName)) if(isset($hasErrorLastName)) it works but when i want to verify it doesent work if(!isset($hasErrorName,$hasErrorLastName)) { some code }
  12. i have a php form that inserts the info in a data base but some guy told me that hes registration does not appear and i think its something wrong with his name like O'Casey the quote what should i use htmlentities, stripslashes or both?
  13. thank you for your suggestion that lead me to mysql_insert_id () and now it works great.
  14. how can i do it i'm thinking of inserting then export place it in a variable and insert again this means 3 queries?
  15. I have two tables in the data base: first one contains id(auto increment) username pass type the second one contains information about the user and another record idUser. What i need is a mysql query that would insert the user into the first table and at the same time inserting the id(auto increment) from first table in the second table in IdUser record. i tried a few things but none working please help. Thank you!
  16. tried this and still not working:(
  17. it has the value of the uploaded file the field is bigint(20) Attributes UNSIGNED Null YES Default 0 i have no idea why its not working maybe someone could help me build another way for display/download.
  18. still not working i tried some other stuff with no luck. please help
  19. now i have longblob the only thing that is readable is .txt everything else i get error or corrupt.
  20. strange thing i found...sometimes it parses download.php for download but only on text/plain file even if it has his mime type
  21. the data field is mediumblob and the mime is image/jpeg i changed the data field in blob and longblob and i get the same thing
×
×
  • 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.