Jump to content

Distant_storm

Members
  • Posts

    137
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Distant_storm's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.