Jump to content

Voodoo Jai

Members
  • Posts

    125
  • Joined

  • Last visited

    Never

Everything posted by Voodoo Jai

  1. removed the extra "(" but still not working, shows a blank screen now.
  2. I am trying to store an ip address in a db without success. I have a table and are field defined as an int to store the value, I then are trying to store using "INET_ATON" like so: the ip value is 127.0.0.1 $ip=$_SERVER['REMOTE_ADDR']; mysql_query("INSERT INTO ipstore (address) VALUES INET_ATON(($ip)") I get this msg how should I be doing this storeage. Thanks advance Voodoojai
  3. I think the counting hits from a specific IP would sort my problem out. What would I need to do. VoodooJai
  4. How can I limit the number of time someone accesses my db without them registering. Could I read the ip address and then store it and allow users to access it a specific number of times based on ip address. I dont know if this could be done or how to do it. If someone could give me some more details that would be great. VoodooJai
  5. I have copied all of my OSC web site and database to my local machine, I have a testing server on my local machine (apache/mysql/php etc) but when I try to show my E shop pages I get a error. I have been into the configure.php file and replaced some bits with what I consider to be the correct info for my local access: servername, db name, user and pwd as shown below. define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://localhost'); // eg, https://localhost - should not be empty for productive servers define('DB_SERVER', 'loaclhost'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'username here'); define('DB_SERVER_PASSWORD', 'pwd here'); define('DB_DATABASE', 'poochim_shop'); having made theses changes I thought all should be fine but its not, can anyone help me.
  6. I have not commented out correctly so now the image shows, but the letters for inout are missing. getting closer to solving it.
  7. I am trying to create an image verification page using these two files <?php //this function is called recursivelly function random_string($len=5, $str='') { for($i=1; $i<=$len; $i++) { //generates a random number that will be the ASCII code of the character. //We only want numbers (ascii code from 48 to 57) and caps letters. $ord=rand(48, 90); if((($ord >= 48) && ($ord <= 57)) || (($ord >= 65) && ($ord<= 90))) $str.=chr($ord); //If the number is not good we generate another one else $str.=random_string(1); } return $str; } //create the random string using the upper function //(if you want more than 5 characters just modify the parameter) $rand_str=random_string(5); //We memorize the md5 sum of the string into a session variable $_SESSION['image_value'] = md5($rand_str); //Get each letter in one valiable, we will format all letters different $letter1=substr($rand_str,0,1); $letter2=substr($rand_str,1,1); $letter3=substr($rand_str,2,1); $letter4=substr($rand_str,3,1); $letter5=substr($rand_str,4,1); //Creates an image from a png file. If you want to use gif or jpg images, //just use the coresponding functions: imagecreatefromjpeg and imagecreatefromgif. //$image=imagecreatefrompng("images/noise.png"); //$image=imagecreatefrompng("fonts/noise.png"); $image=imagecreatefromjpeg("fonts/noise.jpg"); //$image=imagecreatefromgif("fonts/noise.gif"); //Get a random angle for each letter to be rotated with. $angle1 = rand(-20, 20); $angle2 = rand(-20, 20); $angle3 = rand(-20, 20); $angle4 = rand(-20, 20); $angle5 = rand(-20, 20); //Get a random font. (In this examples, the fonts are located in "fonts" directory and named from 1.ttf to 10.ttf) $font1 = "fonts/".rand(1, 10).".ttf"; $font2 = "fonts/".rand(1, 10).".ttf"; $font3 = "fonts/".rand(1, 10).".ttf"; $font4 = "fonts/".rand(1, 10).".ttf"; $font5 = "fonts/".rand(1, 10).".ttf"; //Define a table with colors (the values are the RGB components for each color). $colors[0]=array(122,229,112); $colors[1]=array(85,178,85); $colors[2]=array(226,108,97); $colors[3]=array(141,214,210); $colors[4]=array(214,141,205); $colors[5]=array(100,138,204); //Get a random color for each letter. $color1=rand(0, 5); $color2=rand(0, 5); $color3=rand(0, 5); $color4=rand(0, 5); $color5=rand(0, 5); //Allocate colors for letters. $textColor1 = imagecolorallocate ($image, $colors[$color1][0],$colors[$color1][1], $colors[$color1][2]); $textColor2 = imagecolorallocate ($image, $colors[$color2][0],$colors[$color2][1], $colors[$color2][2]); $textColor3 = imagecolorallocate ($image, $colors[$color3][0],$colors[$color3][1], $colors[$color3][2]); $textColor4 = imagecolorallocate ($image, $colors[$color4][0],$colors[$color4][1], $colors[$color4][2]); $textColor4 = imagecolorallocate ($image, $colors[$color5][0],$colors[$color5][1], $colors[$color5][2]); Write text to the image using TrueType fonts. $size = 20; imagettftext($image, $size, $angle1, 10, $size+15, $textColor1, $font1, $letter1); imagettftext($image, $size, $angle2, 35, $size+15, $textColor2, $font2, $letter2); imagettftext($image, $size, $angle3, 60, $size+15, $textColor3, $font3, $letter3); imagettftext($image, $size, $angle4, 85, $size+15, $textColor4, $font4, $letter4); imagettftext($image, $size, $angle5, 110, $size+15, $textColor5, $font5, $letter5); header('Content-type: image/jpeg'); Output image to browser imagejpeg($image); Destroys the image imagedestroy($image); ?> and the second one to show the iamge <?php session_start(); ?> <HTML> <HEAD> <TITLE>Random image sample</TITLE> <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\"> </HEAD> <BODY> <?php $errors=0; if(isset($_POST['Submit'])) { $number = $_POST['number']; if(md5($number) != $_SESSION['image_value']) echo '<h1>Validation string not valid! Please try again!</h1>'; else { echo '<h1>Your string is valid!</h1>'; //do what you want with the data } } ?> <form name="form1" method="post" action="random_sample.php"> <table cellspacing="0" width="600" align="center"> <tr><td valign="top" align="right">Comments</td> <td><input name="message" size=40 value="...your message here"> </td></tr> <tr><td colspan=2 align="center"> <font size="1" face="Geneva, Arial, Helvetica, sans-serif"><strong><font size="2"> Please enter the string shown in the image in the form.<br> The possible characters are letters from A to Z in capitalized form and the numbers from 0 to 9. </font></td></tr> <tr><td align="center" colspan=2><input name="number" type="text" id=\"number\"></td></tr> <tr><td colspan=2 align="center"><img src="random_image.php"><br><img src="fonts/noise.png"></td></tr> <tr><td colspan=2 align="center"><input name="Submit" type="submit" value="Submit"></td></tr> </table> </form> </BODY> </HTML> the file does not show the graphics to decipher.
  8. Is GD library bundled with PHP, as it shows up in phpinfo now I have removed the semicolons. If so, its not displaying my graphic when loaded into a browser, what are the possible causes of this. Thanks again
  9. If have downloaded the GD library ZIP file, where do I extract it to. I have removed the semicolons from the PHP.ini file, do I need to do anything else. Many thanks VoodooJai
  10. THANK YOU all for your help, much appreciated VoodooJai
  11. I have found out the solution to my problem, at last. It appears to be the FireFox plugin (RealPlayer Browser Plugin 1.0) It seems to be stopping the first image from being viewed using javascript in my code, if you have the same problem then try this. VoodooJai
  12. Sorry that was wrong because I have been tinkering with it. thsi code validates and does not display right still <!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 name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Tabbed browser testing</title> <script type="text/JavaScript"> //<![CDATA[ //here you place the ids of every element you want. var ids=new Array('pictures','video','text','misc'); function switchid(id){ hideallids(); showdiv(id); } function hideallids(){ //loop through the array and hide each element by id for (var i=0;i<ids.length;i++){ hidediv(ids); } } function hidediv(id) { //safe function to hide an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'none'; } else { if (document.layers) { // Netscape 4 document.id.display = 'none'; } else { // IE 4 document.all.id.style.display = 'none'; } } } function showdiv(id) { //safe function to show an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'block'; } else { if (document.layers) { // Netscape 4 document.id.display = 'block'; } else { // IE 4 document.all.id.style.display = 'block'; } } } //]]> </script> <style type="text/css"> /*<![CDATA[*/ <!-- .tabs { background-image: url(images/footer-1.png); height: 25px; width: 100px; background-repeat: no-repeat; } .galleryimage { background-color: #CCCCCC; height: 180px; width: 590px; border: thin solid #000000; } .page { height: 700px; width: 900px; background-color: #FFFFCC; margin-left: auto; margin-right: auto; } .clear { clear: both; } --> /*]]>*/ </style> <style type="text/css"> /*<![CDATA[*/ div.img { margin: 2px; border: 1px solid #0000ff; height: auto; width: auto; float: left; display: inline; } div.img img { display: block; margin: 3px; border: 1px solid #ffffff; } div.img a:hover img {border: 1px solid #0000ff;} div.desc { text-align: center; font-weight: normal; width: 120px; margin: 2px; } /*]]>*/ </style> <style type="text/css"> /*<![CDATA[*/ div.miscDiv {display:none; width: 600px; background-color: #FFFF99;} div.textDiv {display:none; width: 600px; background-color: #FFFF99; height: 400px; overflow: auto;} div.pictureDiv {display:block; width: 600px; background-color: #FFFF99; height: 400px; overflow: auto;} /*]]>*/ </style> </head> <body> <div class="page"> <p>Try these: <a href="javascript:switchid('pictures');">View pictures</a> | <a href="javascript:switchid('video');">View videos</a> | <a href="javascript:switchid('text');">View blog</a> | <a href="javascript:switchid('misc');">Misc</a></p> <div class="tabs"><a href="javascript:switchid('pictures');">View pictures</a></div> <br/> <hr /> <div id='pictures' class="pictureDiv"> <h2>Gallery image viewer:</h2> <p><strong>Lorem ipsum</strong> dolor sit amet, consectetuer adipiscing elit. Sed vitae est. Curabitur eleifend magna ut nulla. Etiam ut nisl. Nullam nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed rhoncus, tellus vitae suscipit pharetra, odio mi hendrerit mauris, quis consectetuer magna lectus eu nulla. Suspendisse potenti. In hac habitasse platea dictumst. Aenean dignissim. Duis ligula.</p> <div class="galleryimage"> <div class="img"><a target="_blank" href="index.html"><img src="images/sample.jpg" alt="Sample" width="110" height="90" /></a> <div class="desc">This image fails to show when refreshed</div> </div> <!--First thumbnail--> <div class="img"><a target="_blank" href="#"><img src="images/sample.jpg" alt="Sample" width="110" height="90" /></a> <div class="desc">Add a description of the image here</div> </div> <!--Second thumbnail--> <div class="img"><a target="_blank" href="index.html"><img src="images/sample.jpg" alt="Sample" width="110" height="90" /></a> <div class="desc">Add a description of the image here</div> </div> <!--Third thumbnail--> <div class="img"><a target="_blank" href="#"><img src="images/sample.jpg" alt="Sample" width="110" height="90" /></a> <div class="desc">Add a description of the image here</div> </div> <!--Fourth thumbnail--> </div><!--END galleryimageDiv--> </div><!--END pictureDiv--> <div id='video' class="textDiv"> <h3>Lorem ipsum</h3> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut sit amet sapien non felis iaculis scelerisque! Proin sem libero, vehicula sit amet, accumsan vitae, vehicula in, nibh. Donec sed mauris tincidunt nibh euismod molestie. Pellentesque nec odio. Phasellus felis. Quisque massa magna, aliquam mattis, ullamcorper sit amet, molestie sed, felis. Aenean at tellus aliquet tortor consequat commodo. Nulla suscipit ullamcorper risus. Curabitur eleifend orci sed dolor. Phasellus quam. Quisque lectus nulla, porttitor ut, lacinia sit amet, mollis quis; mi. Nulla felis. Nam consequat pretium risus? Nulla facilisi. Aenean scelerisque lectus quis massa? Nulla facilisi. In vulputate pede ut eros. In tortor risus, placerat non, cursus non, feugiat eu; metus?</p> <p>Donec et urna a metus faucibus elementum. Nullam aliquet, urna sit amet fermentum cursus, purus mi viverra mauris, a viverra sapien lectus et velit. Pellentesque massa quam, rutrum fermentum, tempor in, consequat ut, nunc. Pellentesque iaculis dignissim diam! Nam tincidunt pede et libero. Nullam libero mauris, dictum a, tempus eu, cursus nec, ante. Etiam odio urna, pretium at, imperdiet et, ornare at, nisi. Proin consectetuer vehicula lacus? Mauris nisl felis, interdum id, molestie vel, semper nec, nisi! Duis et est volutpat augue volutpat molestie? Aliquam fermentum laoreet nisl. Nam iaculis. Fusce eget diam eget ligula pretium aliquet. Suspendisse fringilla fringilla massa. Donec accumsan luctus dolor. Integer consequat commodo sem. Phasellus libero odio; mattis convallis, tristique eget, venenatis vel, nisi. Vestibulum vel dui quis urna elementum vehicula. Fusce mattis accumsan dolor! Aliquam a tortor.</p> <p>Nunc vitae felis eu odio sodales sollicitudin. Vivamus volutpat lobortis felis. Vivamus nunc! Suspendisse non lacus. Sed consequat nisl varius augue? Nunc ante diam, varius ut, pulvinar ut, semper id, ligula? Aliquam erat volutpat. Integer iaculis pede in sapien. Pellentesque augue. Etiam nec velit nec turpis commodo sodales. Donec vel odio. Nam aliquam turpis non nibh bibendum congue. Nam eleifend justo dapibus nisl. Pellentesque laoreet, leo nec placerat ultrices, nunc arcu placerat ante; pulvinar pellentesque tellus diam quis libero! Quisque eu sem quis nisl gravida sagittis. Etiam ligula purus, tincidunt ut, vulputate eget, posuere eu, tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p> </div><!--END textDiv--> <br/> <hr /> <div id='text' class="textDiv"> <h3>This content is for text</h3> <p><strong>Lorem ipsum</strong> dolor sit amet, consectetuer adipiscing elit. Sed vitae est. Curabitur eleifend magna ut nulla. Etiam ut nisl. Nullam nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed rhoncus, tellus vitae suscipit pharetra, odio mi hendrerit mauris, quis consectetuer magna lectus eu nulla. Suspendisse potenti. In hac habitasse platea dictumst. Aenean dignissim. Duis ligula.</p> </div><!--END textDiv--> <div id='misc' class="miscDiv"> <h3>This content is for misc text</h3> <p><strong>Lorem ipsum</strong> dolor sit amet, consectetuer adipiscing elit. Sed vitae est. Curabitur eleifend magna ut nulla. Etiam ut nisl. Nullam nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed rhoncus, tellus vitae suscipit pharetra, odio mi hendrerit mauris, quis consectetuer magna lectus eu nulla. Suspendisse potenti. In hac habitasse platea dictumst. Aenean dignissim. Duis ligula. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed vitae est. Curabitur eleifend magna ut nulla. Etiam ut nisl. Nullam nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed rhoncus, tellus vitae suscipit pharetra, odio mi hendrerit mauris, quis consectetuer magna lectus eu nulla. Suspendisse potenti. In hac habitasse platea dictumst. Aenean dignissim. Duis ligula. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed vitae est. Curabitur eleifend magna ut nulla. Etiam ut nisl. Nullam nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed rhoncus, tellus vitae suscipit pharetra, odio mi hendrerit mauris, quis consectetuer magna lectus eu nulla. Suspendisse potenti. In hac habitasse platea dictumst. Aenean dignissim. Duis ligula.</p> </div><!--END miscDiv--> </div><!--END page--> <p> <a href="http://jigsaw.w3.org/css-validator/" target="_blank"><img style="border:0; width:88px; height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /></a> <a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a></p> <div/> </body> </html> it can be viewed again using the link supplied above.
  13. I have posted the code above and also posted a separate topic but no one seems to be able to solve it. Here it is again. <!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=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> div.img { margin: 2px; border: 1px solid #0000ff; height: auto; width: auto; float: left; text-align: center; } div.img img { display: inline; margin: 3px; border: 1px solid #ffffff; } div.img a:hover img { border: 1px solid #0000ff; } div.desc { text-align: center; font-weight: normal; width: 120px; margin: 2px; } </style> </head> <body> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> [/url] <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis2_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> [/url] <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis3_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> [/url] <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis4_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> [/url] <div class="desc">Add a description of the image here</div> </div> </body> </html> I aslo have a live link to show what I maen about not displayin correctly. http://76.163.15.45/Untitled-7a.html
  14. The page validates OK so why wont the page display correctly with doctype included. Is it the wrong definition.
  15. So is the first couple of lines not needed in this page, as it works right with out them but not with them included. <!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=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> div.img { margin: 2px; border: 1px solid #0000ff; height: auto; width: auto; float: left; text-align: center; } div.img img { display: inline; margin: 3px; border: 1px solid #ffffff; } div.img a:hover img { border: 1px solid #0000ff; } div.desc { text-align: center; font-weight: normal; width: 120px; margin: 2px; } </style> </head> <body> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis2_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis3_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis4_big.htm"> <img src="images/sample.jpg" alt="Klematis" width="153" height="94" /> </a> <div class="desc">Add a description of the image here</div> </div> </body> </html>
  16. What DOCTYPE do I need to use for a CSS page. <!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"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/loose.dtd"> is it one of these or not. Cheers
  17. After some more investigation I find that the first image used is not visible but if I right click and view image it shows it. I think the problem may be a bug in FF. I placed the thumbnail gallery at the start of the page and again the image fails to show.
  18. Hi again thanks again for your time this problem is annoying. I have put some details on the page explaining the effect and added another row of images to show how the top row of images should look. http://76.163.15.45/Untitled-7a.html
  19. Its not working for my browser (Firefox/2.0.0.14) even on the remote server its the same. I tried it from a different PC but still using FF and it was the same. What version of FF did you try. Thanks for your patience
  20. I have figured that my problem is style inheritence from nested div tags, how do I stop them from inheriting from parent div tags. I still want to have the divs nested. Thanks a lot
  21. Here is a live link and the problem shows when you refresh it in Firefox. http://76.163.15.45/Untitled-7a.html Hope you can help me.
  22. Do you mean a link for you to go to on the web or because the img only links to the same page via #
  23. I have validated the page using the link and only a few probs showed up I fixed them but the main problem still persists. I think it may be to do with the CSS classes because of the nesting of the div tags, not sure.
  24. I am coding in fire fox but can not get it to display correctly within the div tag if I place it outside the tag it works and refreshes as intended. Where do I find details about compliant browser codeing.
×
×
  • 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.