Jump to content

Fenhopi

Members
  • Posts

    121
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Fenhopi's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Thanks for you reply! But, it didn't work..
  2. Okay, so I have this site mydomain.com. When the user logs on there I want the user to be able to go to forum.mydomain.com without getting logged out. So I've googled this for days, and here's what I've found out: I don't have access to my hosts php.ini file, so I can't change anything there. I've put ini_set("session.cookie_domain", ".mydomain.com"); on top of my session.php file. I've edited the .htaccess in both the forum folder and my root folder to php_value session.cookie_domain ".mydomain.com" . Still, after all this; it's totally random wether the session works on both or not. Sometimes it works, others it doesn't. I think perhaps it usually stops working after I've edited on some files on my site.. but I just have no idea what's wrong.. All help would be appriciated!
  3. Thanks for replying! Okay, I tried this, with no success.. <? include("include/session.php"); ?> <html> <head> <title>Preload Image Page</title> <script language="JavaScript1.1"> <!-- begin hiding /* Preload Image With Update Bar Script (By Marcin Wojtowicz [one_spook@hotmail.com]) Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive For full source code to this script and 100's more, visit http://dynamicdrive.com */ // You may modify the following: var locationAfterPreload = "http://dynamicdrive.com" // URL of the page after preload finishes var lengthOfPreloadBar = 150 // Length of preload bar (in pixels) var heightOfPreloadBar = 15 // Height of preload bar (in pixels) // Put the URLs of images that you want to preload below (as many as you want) <?php $Get_pictures = "SELECT bilde FROM beis"; $Connect_bilde = $database->query($Get_pictures); while($rad = mysql_fetch_array($Connect_bilde)){ $my_array[] = $rad['bilde']; } $nummer = count($my_array); echo "var yourImages = new Array(" . $nummer . ");"; $stab = "0"; while($stab < $nummer){ echo " yourImages[".$stab."]=".$my_array[$stab]."\n"; $stab++; } ?> // Do not modify anything beyond this point! if (document.images) { var dots = new Array() dots[0] = new Image(1,1) dots[0].src = "images/black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size) dots[1] = new Image(1,1) dots[1].src = "images/blue.gif" // color of bar as preloading progresses (same note as above) var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0 var loaded = new Array(),i,covered,timerID var leftOverWidth = lengthOfPreloadBar%coverage } function loadImages() { for (i = 0; i < yourImages.length; i++) { preImages[i] = new Image() preImages[i].src = yourImages[i] } for (i = 0; i < preImages.length; i++) { loaded[i] = false } checkLoad() } function checkLoad() { if (currCount == preImages.length) { location.replace(locationAfterPreload) return } for (i = 0; i <= preImages.length; i++) { if (loaded[i] == false && preImages[i].complete) { loaded[i] = true eval("document.img" + currCount + ".src=dots[1].src") currCount++ } } timerID = setTimeout("checkLoad()",10) } // end hiding --> </script> </head> <body bgcolor="#FFFFFF"> <center> <font size="4">Please be patient while some images<br> are being preloaded...</font><p> 0% <script language="JavaScript1.1"> <!-- begin hiding // It is recommended that you put a link to the target URL just in case if the visitor wants to skip preloading // for some reason, or his browser doesn't support JavaScript image object. if (document.images) { var preloadBar = '' for (i = 0; i < yourImages.length-1; i++) { preloadBar += '<img src="' + dots[0].src + '" width="' + coverage + '" height="' + heightOfPreloadBar + '" name="img' + i + '" align="absmiddle">' } preloadBar += '<img src="' + dots[0].src + '" width="' + (leftOverWidth+coverage) + '" height="' + heightOfPreloadBar + '" name="img' + (yourImages.length-1) + '" align="absmiddle">' document.write(preloadBar) loadImages() } document.write('<p><small><a href="javascript:window.location=locationAfterPreload">Skip Preloading</a> | <a href="http://dynamicdrive.com/">Script Credits</a></small></p>') // end hiding --> </script> </center> </body> </html>
  4. Hi, I retrieve the pictures I want to display through a php loop that stores them in an array. What I want to do is to get those array values to get recognized by my js preloading script. Any tips how I'd do that? Here's my code (The relevant part is at the top): <html> <head> <title>Preload Image Page</title> <?php $Get_pictures = "SELECT bilde FROM beis"; $Connect_bilde = $database->query($Get_pictures); while($rad = mysql_fetch_array($Connect_bilde)){ $my_array[] = $rad['bilde']; } ?> <script language="JavaScript1.1"> <!-- begin hiding /* Preload Image With Update Bar Script (By Marcin Wojtowicz [one_spook@hotmail.com]) Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive For full source code to this script and 100's more, visit http://dynamicdrive.com */ // You may modify the following: var locationAfterPreload = "http://dynamicdrive.com" // URL of the page after preload finishes var lengthOfPreloadBar = 150 // Length of preload bar (in pixels) var heightOfPreloadBar = 15 // Height of preload bar (in pixels) // Put the URLs of images that you want to preload below (as many as you want) var yourImages = new Array("<? echo $my_array; ?>","http://yourdomain.com/test2.gif") // Do not modify anything beyond this point! if (document.images) { var dots = new Array() dots[0] = new Image(1,1) dots[0].src = "black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size) dots[1] = new Image(1,1) dots[1].src = "blue.gif" // color of bar as preloading progresses (same note as above) var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0 var loaded = new Array(),i,covered,timerID var leftOverWidth = lengthOfPreloadBar%coverage } function loadImages() { for (i = 0; i < yourImages.length; i++) { preImages[i] = new Image() preImages[i].src = yourImages[i] } for (i = 0; i < preImages.length; i++) { loaded[i] = false } checkLoad() } function checkLoad() { if (currCount == preImages.length) { location.replace(locationAfterPreload) return } for (i = 0; i <= preImages.length; i++) { if (loaded[i] == false && preImages[i].complete) { loaded[i] = true eval("document.img" + currCount + ".src=dots[1].src") currCount++ } } timerID = setTimeout("checkLoad()",10) } // end hiding --> </script> </head> <body bgcolor="#FFFFFF"> <center> <font size="4">Please be patient while some images<br> are being preloaded...</font><p> 0% <script language="JavaScript1.1"> <!-- begin hiding // It is recommended that you put a link to the target URL just in case if the visitor wants to skip preloading // for some reason, or his browser doesn't support JavaScript image object. if (document.images) { var preloadBar = '' for (i = 0; i < yourImages.length-1; i++) { preloadBar += '<img src="' + dots[0].src + '" width="' + coverage + '" height="' + heightOfPreloadBar + '" name="img' + i + '" align="absmiddle">' } preloadBar += '<img src="' + dots[0].src + '" width="' + (leftOverWidth+coverage) + '" height="' + heightOfPreloadBar + '" name="img' + (yourImages.length-1) + '" align="absmiddle">' document.write(preloadBar) loadImages() } document.write('<p><small><a href="javascript:window.location=locationAfterPreload">Skip Preloading</a> | <a href="http://dynamicdrive.com/">Script Credits</a></small></p>') // end hiding --> </script> </center> </body> </html>
  5. Hi, I'm aware that there are some difficulties with using javascript in php loops because of the client side and server side work that's being done. Anyways, here's what I got: Code: function alertBox() { document.sendform.to2.value = document.getElementById('test3').value; document.sendform.to.value = document.getElementById('test4').value; e.style.display="none"; } while ($row = mysql_fetch_array($getRecord)) { $TheirProfilePicture = $row['profilepicture']; $mysock = getimagesize("http://face2blog.comlu.com/images/uploads/$TheirProfilePicture?time=time()");?> <li><a href="#" onClick="alertBox();" id="test"><img src="http://face2blog.comlu.com/images/uploads/<? echo $TheirProfilePicture ?>?time=<?php echo time(); ?>" <? echo imageResize($mysock[0], $mysock[1], 45); ?> /> <font color="grey" size="3"><?php echo $row['firstname']; ?> <?php echo $row['lastname']; ?></font><input type="hidden" id="test3" value="<?php echo $row['firstname']; ?> <?php echo $row['lastname']; ?>"><input type="hidden" id="test4" value="<?php echo $row['username']; ?>"></a></li> <?php } Please ignore the lach of script tags, I'm just pasting in what's relevant. This is the code of my autosuggest search thingy. When a user clicks one of the suggestions I'd like alertbox(); to get the info of the one I picked, not the last result that was looped. Is there a way or a trick that I could do to make this work with ajax? Thank you in advance!
  6. Hi, I'm aware that there are some difficulties with using javascript in php loops because of the client side and server side work that's being done. Anyways, here's what I got: function alertBox() { document.sendform.to2.value = document.getElementById('test3').value; document.sendform.to.value = document.getElementById('test4').value; e.style.display="none"; } while ($row = mysql_fetch_array($getRecord)) { $TheirProfilePicture = $row['profilepicture']; $mysock = getimagesize("http://face2blog.comlu.com/images/uploads/$TheirProfilePicture?time=time()");?> <li><a href="#" onClick="alertBox();" id="test"><img src="http://face2blog.comlu.com/images/uploads/<? echo $TheirProfilePicture ?>?time=<?php echo time(); ?>" <? echo imageResize($mysock[0], $mysock[1], 45); ?> /> <font color="grey" size="3"><?php echo $row['firstname']; ?> <?php echo $row['lastname']; ?></font><input type="hidden" id="test3" value="<?php echo $row['firstname']; ?> <?php echo $row['lastname']; ?>"><input type="hidden" id="test4" value="<?php echo $row['username']; ?>"></a></li> <?php } Please ignore the lach of script tags, I'm just pasting in what's relevant. This is the code of my autosuggest search thingy. When a user clicks one of the suggestions I'd like alertbox(); to get the info of the one I picked, not the last result that was looped. Is there a way or a trick that I could do to make this work? Thank you in advance!
  7. Hi, I have a few links on my site. What I need is for when I click one of these links I want the link text to appear in the textbox above. Is this doable?
  8. That's what I ended up doing. Something the obvious takes awhile to see.
  9. Yeah.. Possibly. I just want to find which rows have the right username as well as the status: 0, and have them returned.. And I really thought the query would do that..
  10. I want my query to return the values where person='$username' and status=0 from one table, and the same in another table. Here's what I got: $GetStatus = "SELECT comments.status, friends.status FROM comments, friends WHERE (comments.person='$username' AND comments.status='0') OR (friends.user2='$username' AND friends.status='0')"; However it just returns values from different rows where the status is different than 0..
  11. Hi, I have this piece of code: function GetAlerts(){ $username = mysql_real_escape_string($_SESSION['username']); $GetStatus = "SELECT comments.status, friends.status FROM comments, friends WHERE comments.person='$username' AND friends.user2='$username'"; $Connect = $database->query($GetStatus); $NumberRows = mysql_num_rows($Connect); return $NumberRows; } When I call the function I get: Fatal error: Call to a member function query() on a non-object And it points to the $GetStatus line. However, if I just use the code like this: $username = mysql_real_escape_string($_SESSION['username']); $GetStatus = "SELECT comments.status, friends.status FROM comments, friends WHERE comments.person='$username' AND friends.user2='$username'"; $Connect = $database->query($GetStatus); $NumberRows = mysql_num_rows($Connect); echo $NumberRows; it works perfectly.. Any ideas? Thanks in advance.
  12. Hi, my website allows users to upload pictures. But when I display these pictures I need them all to not be larger than a certain max width and height.. Is it some tutorial on how to fit images proportionately? Thank you!
  13. Hi, I'm building a blog, and I want the user to be able to add images to their entry. But I can't quite figure out how to this without risking injections. I see that most sites, such as phpfreaks has the img tags with brackets. Any suggestions how I'd go about doing that? All help appreciated!
×
×
  • 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.