Jump to content

Distant_storm

Members
  • Posts

    137
  • Joined

  • Last visited

    Never

Everything posted by Distant_storm

  1. Sorry yes... <select name=album_selection><option value=N>Choose</option> That is a dropdown box. When the button is pressed it goes to the javascript function stated above. This function attempts to get the value of the dropdown box option selected, which it does in IE say for example N like above. It then uses this in GET method making a request AJAX style to another php page which works fine in either IE or FIREFOX. Yet firefox is saying there is no property of album_selection ? Do i have to use another method to get the value of the drop down box ?
  2. it is quoting that document.getElementById("album_selection").value has no properties Any ideas ? It also has 100 other errors but I think thats just firefox being particular as their mostly colour errors
  3. Ok now i have the cookie working but, The Ajax request works on on page but not another yet works on both in IE here is the code for the page that doesn't work... //Create a boolean variable to check for a valid Internet Explorer instance. var xmlhttp = false; //Check if we are using IE. try { //If the Javascript version is greater than 5. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { //If not, then use the older active x object. try { //If we are using MS. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { //Else we must be using a non-IE browser. xmlhttp = false; } } //If we are using a non-IE browser, create a javascript instance of the object. if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } /* var xmlhttp; //If, the activexobject is available, we must be using IE. if (window.ActiveXObject){ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else { //Else, we can use the native Javascript handler. xmlhttp = new XMLHttpRequest(); } */ function makerequest(serverPage, objID) { var obj = document.getElementById(objID); xmlhttp.open("GET", serverPage); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } function display_album_box() { var theselectbox = document.getElementById("album_selection").value; makerequest("album_viewing_page.php?album_ident=" + theselectbox,"album_viewer"); var thealbumbox = document.getElementById("album_viewer"); thealbumbox.style.visibility="visible"; } and then the page <div id=album_viewer></div><div class=main_mid><center><table width=100% align=center><tr><td colspan=2 class=title_bar width=100%> <center><font class=title_font>Album Browser</font></center></td></tr> <tr><td> </td></tr> <tr><td>Please choose an album $album_listing <input type=submit name=submit value=Go onclick=\"display_album_box()\"</td></tr></table></div>"; and the page being requested works fine
  4. I don't know if its conflict with SSL or Firefox but Ajax requests don't work even when my code snifs the browser type and makes a request ocordingly. The cookie works fine on index page and yet on the page on the SSL server doesn't display the propper page?
  5. I have a index page. It checks to see if a cookie value exists if so then carry on doing what it does. I have a resolution page checker. It gets the users resolution then allows a link to the index page with that resolution sent via GET. which then creates a cookie to allow the index page to carry on usual This all works fine in Internet explorer However in firefox it just keeps re-directing back to the resolution page as if the cookie doesn't exist. Any ideas Its an SSL Server
  6. Still getting error ive addapted the code but not to ken's standard because ive never had to do it any other way in the past and its been fine. im thinking its something else. here is my adapted login part of the code. I still get 404 error which is really anoying because its such simple code.. <?php ob_start(); //simple password $press_pw="23d45b337ff85d0a326a79082f7c6f50"; $count_pw="5f6371c9126149517d9ba475def53139"; $error="FALSE"; if (empty($_POST['inv'])) { $tag="n"; } else { $tag=$_POST['inv'];aa } if (ctype_alnum($_POST['us']) AND ctype_alnum($_POST['pa'])) { $in_pw=md5($_POST['pa']); $in_us=$_POST['us']; switch ($in_us) { case "scfc": if ($count_pw != $in_pw) { $error="TRUE"; } break; case "press": if ($press_pw != $in_pw) { $error="TRUE"; } break; DEFAULT: $error="TRUE"; break; } $ip=$_SERVER['REMOTE_ADDR']; setcookie ("key",$in_pw,time() + 3600*24,'/','',0); setcookie ('user_id',$ip,time() + 3600*24,'/','',0); header("location:XXXXXXX?inv=$tag"); } else { $error="TRUE"; } if ($error=="TRUE") { header("Location:error.php"); } ob_end_flush(); ?>
  7. both files are in the same directory
  8. I have a script that sends form data to another the simplest php script ever yet when it goes to the login page it says 404 error page not found. Refresh the page and its although the data hasn't been sent but displays the error page. Why is this happening, here is the scripts... <form method=POST action=login.php><table><tr><td colspan=2><center><b>Login</b></center></td></tr> <tr><td>Username: </td><td><input type=text name=us></td></tr> <tr><td>Password: </td><td><input type=password name=pa></td></tr> <tr><td colspan=2><center><img src=cap.php></center></td></tr> <tr><td colspan=2><center><font size=2pt>Type the word in the text box below</font></center></td></tr> <tr><td colspan=2><center><input type=text name=inv></center></td></tr> <tr><td colspan=2><center><input type=submit name=log value=Login></center></td></tr> </table></form> login.php <?php //simple password $press_pw="23d45b337ff85d0a326a79082f7c6f50"; $count_pw="5f6371c9126149517d9ba475def53139"; if (ctype_alnum($_POST['us']) AND ctype_alnum($_POST['pa'])) { $in_pw=md5($_POST['pa']); $in_us=$_POST['us']; switch ($in_us) { DEFAULT: header("Location:error.php"); break; case "scfc": if ($count_pw != $in_pw) { header("Location:error.php"); } break; case "press": if ($press_pw != $in_pw) { header("Location:error.php"); } break; } $ip=$_SERVER['REMOTE_ADDR']; setcookie ("key",$in_pw,time() + 3600*24,'/','',0); setcookie ('user_id',$ip,time() + 3600*24,'/','',0); $tag=$_POST['inv']; header("location:anuthpage.php?inv=$tag"); } else { header("Location:error.php"); }
  9. I am using a script that reads the image file and then displays it... if (!isset($_GET['pho']) || !ctype_digit($_GET['pho'])) { header("Content-type: image/jpeg"); $im = imagecreatefromjpeg("No_image_display.jpeg"); imagejpeg($im); imagedestroy($im); } else { $photo_id=$_GET['pho']; if ($dbc = @mysql_connect('lllllll','nnnnn','kkkkkk')) { if (@mysql_select_db('kazphotos')) { $photo_id= mysql_real_escape_string($photo_id); $query="SELECT * FROM photos WHERE Photo_id='$photo_id'"; if ($r= mysql_query ($query)) { while ($row = mysql_fetch_array($r)) { $photo_path="XXXXXXX/XXXXXX/" . $row['Photo']; } } } } header("Content-type: image/jpeg"); $handle = @fopen($photo_path,'r'); while(!feof($handle)) { echo fread($handle, 9000); } } however a page uses this script to call multiple images one by one uusing <img src=image.ph?pho=3> Yet sometimes somewhat random photos don't display, why woudl this be ?
  10. See the problem i have is the X amount of images there can be any amount as there uploaded whenever. so there could be dead on 8 or there could be 6
  11. I am trying to make an image gallery type thing this is how it works Large image here < thumbnails here > i want it to retrieve 4 thumbnails and have links to the next 4 and previous 4 although i dnt want to use some mucky sql statment that i don't understand. unless someone can explani it. ive read the tutorial on it but its abit vague I have attempted but come to an end when i can't work out some logic to stop it retreivin photos when they don't exist.
  12. <img src=image.php?photo=1 height=100 width=100> is not resizing my image why ?
  13. Would this be put in a file with header type as image and then called like <img src=make_image.php also the paths are checked and so do i just use the full path of the file ?
  14. can you please give an example of reading it out to the user
  15. I plan to use this in a page as an example header("image/png"); < or whaterver it is imagefrompng("image.png"); ok now creating an image everytime a user see's the iamge or navigates to a new iamge. and destroying it after woudl this lay heavy on the server ? This is to stop image pathnames from being revealed
  16. thank you for that, sometimes its just right infront of you but you don't see it.
  17. Whats wrong with this section of code $database_photo_list[] = $row['Photo_id']; $dkc = database_photo_list[$loop_count]; $database_photo_cap[$dkc] = $row['Caption']; $database_photo_name[$dkc] = $row['Name']; $database_photo_path[$dkc] = $row['Photo']; $loop_count++; } } i get this error unexpected [ i can't see the erorr for the life of me haha all arrays are declared at the start as arrays
  18. Yeh sorry i have and all the appropriate settings before setting the ini up. I didn't include my full code because theirs loads. If I can't figure this out im buggard hahha
  19. this part of the code is in the index'd file if ($page_directory != 0 && check_auth_user_() != "ALLOW") { header("LOCATION:index.php?direct=0"); exit(); } $page_directory = navigation pointer check_auth_user_() checks login see code below. navigation pointer of 0 = login page. function check_auth_user_() { $matrix_path="MYSESSIONPATH"; ini_set('session.save_path',"../../" . $matrix_path . "_"); ini_set('session.gc_maxlifetime', '1440'); session_start(); if (isset($_SESSION['auth']) && isset($_SESSION['user_id'])) { if ($dbc = @mysql_connect('host','XXXXX','XXXXX')) { if (@mysql_select_db('DATEBASE')) { $name=$_SESSION['user_id']; $query="SELECT * FROM administration WHERE ID='$name'"; if ($r= mysql_query ($query)) { while ($row = mysql_fetch_array($r)) { $password=$_SESSION['auth']; $do_auth= md5($password . $row['key']); $auth_true= md5($row['password'] . $row['key']); if ($do_auth == $auth_true) { return("ALLOW"); } else { return("DENIE"); } } } } } } } that is the code for the check function. Non of the login has been changed, non of the database entries have changed??? What woudl make the script randomly log me out
×
×
  • 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.