Jump to content

Aviway

Members
  • Content Count

    37
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Aviway

  • Rank
    Newbie
  • Birthday 05/27/1982

Profile Information

  • Location
    Israel
  1. Sorry about the spam, but can someone help me?
  2. I'm sorry' but can you explain to me with code, becouse I dont know how to do it!
  3. function change_city(area_id){document.getElementById('city_loader').style.display='block';var xmlhttp; if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();}else{ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200) { var result = xmlhttp.responseText; if (result) document.getElementById('city_loader').style.display='none'; document.getElementById('error_log').innerHTML='PROBLAM!'; }}xmlhttp.open("GET","pages/update/change_city_by_area.php?area_id="+encodeURIComponent(area_id),true);xmlhttp.send(null);} This is the function that call with "onclick" event. My problam is how to include the array that I'm returned from "change_city_by_area.php", inside the other SELECT TAG(city). I use this ajax code for a lot of things but i never used it to get response with array.
  4. Hello,I need help writing a code in AJAX. I have a form where you had to choose an area in the country,and after selecting the regionin the country,another SELECT tag will only see the cities that are in the selected area.The PHP\HTML code: <select id="area" name="area"><?phpforeach ($get_all_area as $key => $val){ echo '<option onclick="change_city('.$val['area_id'].')" value="'.$val['area_id'].'">'.$val['area_name'].'</option>';}?></select> ]<select id="city" name="city"><!-- All cities are in the selected area --></select>
  5. Thanks man it works great! :good:
  6. First of all, relax. Its look like you are angry.I will explain myself again:I want to write a navigation menu that is built from UL TAG and H TAG inside it.To the main DIV TAG must have a CSS FLOAT command. that is because of all DIV'S are with CSS FLOAT command on my code.It must be on UL TAG because of the LI'S inside it are changing each page by the SQL Query. It says, on one page can have only 5 LI's Tags, and they got enter in one row, and can be another page will be15 LI'S Tags, and they do not enter one row but got a second row, and even third row. Previously noted in the code for just one row. Once it got to the second row,the LI'S tags was not centered like the first row.Now I need a code that will feet to this conditions. Thank you for the Reference.
  7. this code is'nt good for list with a several lines.
  8. Hello,I got stuck again and again the problem that I can not find a solution.I created a navigation bar that build that way: <ul> <li> <a><h3>head name</h3></a> </li></ul> and css code: ul{float:right; width:636px; height:25px;}li{display:inline; padding:0 15px; float:right; height:23px; width:180px; text-align:center;}h3{font-size:15px; font-weight: normal;} The problem is I can not center the list, because the FLOATcommand,and if I remove the FLOAT, H3 tag take control and returns the list to be not on INLINE mode.I'm looking for the code to do that where ever i want, and not to wright it each time from the start. Thanx in advance!!
  9. After tring changing permissions/ still not working!
  10. I changed the permissions it still does not work.By the way what permissions a priority,I'll try again.
  11. Hello everyone,I have a problem I can not solve for a long time.I created a form in my site management system that adds to the DataBase various links.The problemis that once I submit the form,appears to me an forbidden massage.This message appears to me even when I try to insert a new banner (flashcode).If possible I have to do it without this message appear? The message: ForbiddenYou don't have permission to access /admin/pages/update/add_new_banner.php on this server.Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Urgent Help Needed,Thanks in advance helpers.
  12. Hi,I have a little problem with my entry system to my CMS/I have a CMS with a few managers. I want to identify them each time that one of them or all of them enter to the CMS.For that I build an entry form with username and password, each manager should type his UN&Pass, for the CMS to identify him. <form method="post" action="check_login.php" name="entry_frm"> <label>שם:</label><input type="text" name="entry_name" /><br /><br /> <label>סיסמא:</label><input type="password" name="entry_pass" /><br /><br /> <input type="submit" /></form> I ran into a Hebrew problem. The Username that i chose for the managers is they're first name in hebrew.But when I submit the form, this masage is appears: .This is the php login code: (check_login.php)<? $username = $_POST['entry_name']; $password = $_POST['entry_pass']; if ($username&&$password) { $query = mysql_query("SELECT * FROM users WHERE user_name='$username'"); $numrows = mysql_num_rows($query); if($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['user_name']; $dbpassword = $row['user_password']; } // check to see if they match if ($username==$dbusername&&$password==$dbpassword) { header('Location:index.php'); $_SESSION['user_name']=$dbusername; } else echo "Incorect password"; }else die("That user doesnt exist!"); } else die("Please fill the fields");?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-type" content="text/html;charset=UTF-8" /></head><body></body></html> I directed the DB collation to "utf8_unicode_ci"Thanks in advance
  13. Aviway

    Swf (flash) Upload

    Hallow,What should I do in this code that I could upload flash fils.Which Extention I need to add to this code: <?php//define a maxim size for the uploaded imagesdefine ("MAX_SIZE","1000");// define the width and height for the thumbnail// note that theese dimmensions are considered the maximum dimmension and are not fixed,// because we have to keep the image ratio intact or it will be deformeddefine ("WIDTH","660");define ("HEIGHT","40");//define ("WIDTH2","300");//define ("HEIGHT2","300");define ("GALLERY_FOLDER","../gallery");// this is the function that will create the thumbnail image from the uploaded image// the resize will be done considering the width and height defined, but without deforming the imagefunction make_thumb($img_name,$filename,$new_w,$new_h){//get image extension.$ext=getExtension($img_name);//creates the new image using the appropriate function from gd libraryif(!strcmp("jpg",$ext) || !strcmp("jpeg",$ext))$src_img=imagecreatefromjpeg($img_name);if(!strcmp("png",$ext))$src_img=imagecreatefrompng($img_name);//gets the dimmensions of the image$old_x=imageSX($src_img);$old_y=imageSY($src_img);// next we will calculate the new dimmensions for the thumbnail image// the next steps will be taken:// 1. calculate the ratio by dividing the old dimmensions with the new ones// 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable// and the height will be calculated so the image ratio will not change// 3. otherwise we will use the height ratio for the image// as a result, only one of the dimmensions will be from the fixed ones$ratio1=$old_x/$new_w;$ratio2=$old_y/$new_h;if($ratio1>$ratio2) {$thumb_w=$new_w;$thumb_h=$old_y/$ratio1;}else {$thumb_h=$new_h;$thumb_w=$old_x/$ratio2;}// we create a new image with the new dimmensions$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);// resize the big image to the new created oneimagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);// output the created image to the file. Now we will have the thumbnail into the file named by $filenameif(!strcmp("png",$ext))imagepng($dst_img,$filename);elseimagejpeg($dst_img,$filename);//destroys source and destination images.imagedestroy($dst_img);imagedestroy($src_img);}// This function reads the extension of the file.// It is used to determine if the file is an image by checking the extension.function getExtension($str) { return array_pop(explode('.', $str));}// This variable is used as a flag. The value is initialized with 0 (meaning no error found)//and it will be changed to 1 if an errro occures. If the error occures the file will not be uploaded.$errors=0;// checks if the form has been submittedif(isset($_POST['Submit'])){//reads the name of the file the user submitted for uploading$image=$_FILES['image']['name'];// if it is not emptyif ($image){// get the original name of the file from the clients machine$filename = stripslashes($_FILES['image']['name']);// get the extension of the file in a lower case format$extension = getExtension($filename);$extension = strtolower($extension);// if it is not a known extension, we will suppose it is an error, print an error message//and will not upload the file, otherwise we continueif (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")){echo '<h1>Unknown extension!</h1>';$errors=1;}else{// get the size of the image in bytes// $_FILES[\'image\'][\'tmp_name\'] is the temporary filename of the file in which the uploaded file was stored on the server$size=getimagesize($_FILES['image']['tmp_name']);$sizekb=filesize($_FILES['image']['tmp_name']);//compare the size with the maxim size we defined and print error if biggerif ($sizekb > MAX_SIZE*1024){echo '<h1>You have exceeded the size limit!</h1>';$errors=1;}//we will give an unique name, for example the time in unix time format$image_name=time().'.'.$extension;//the new name will be containing the full path where will be stored (images folder)$newname=GALLERY_FOLDER."/original/".$image_name;$copied = copy($_FILES['image']['tmp_name'], $newname);//we verify if the image has been uploaded, and print error insteadif (!$copied){echo '<h1>Copy UN-successfull!</h1>';$errors=1;}else{// the new thumbnail image will be placed in images/thumbs/ folder$thumb_name=GALLERY_FOLDER.'/small_thumbs/'.$image_name;//$thumb_name2=GALLERY_FOLDER.'/big_thumbs/'.$image_name;// call the function that will create the thumbnail. The function will get as parameters//the image name, the thumbnail name and the width and height desired for the thumbnail$thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT);$thumb2=make_thumb($newname,$thumb_name2,WIDTH2,HEIGHT2);}} }}//If no errors registred, print the success message and show the thumbnail image createdif(isset($_POST['Submit']) && !$errors){//echo "<h1>Thumbnail created Successfully!</h1>";//echo '<img src="'.$thumb_name.'">';// DB DB DB DB DB DB DB DB DB DB DB DB DB // DB DB DB DB DB DB DB DB DB DB DB DB DB /*unlink('images/small_thumbs/'.$image_from_db);unlink('images/big_thumbs/'.$image_from_db);unlink('images/original/'.$image_from_db);*/ $url = $_POST['url']; update_new_ban($image_name, $url, $type); header('Location:update_banners.php?type='.$type.'');}?> <!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" --> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td><input type="file" name="image"></td></tr> <tr><td><input type="text" name="url" /> : URL</td></tr> <tr><td><input name="Submit" type="submit" value="Upload image"></td></tr> </table> </form>
  14. Aviway

    Xml Link To Rss

    Hallow,I have the next RSS link for showing news on my site: http://www.ynet.co.il/Integration/StoryRss1854.xml What is the script for showin this rss on my site.TANX.
×
×
  • Create New...