Jump to content

imrie

Members
  • Posts

    139
  • Joined

  • Last visited

Everything posted by imrie

  1. You could just use a moving gif to show the page is doing something.
  2. imrie

    Not That One!

    XHTML 1.1 is not compatiable with IE 7.0, perhaps 6.0 too. The reason it is working with IE is because you are not serving the pages correctly, you are using text/html. This makes it compatible with IE 7.0 although it is incorrect you should use the application/xhtml+xml.
  3. imrie

    mysql [?]

    Similar if not exactly the same post to the one you posted in the php section...If you wanted to write the file content to a database table then use it in a another page...this is possible, you can create a textarea for you to write your code into then insert into the table. <form action="<?php echo $_SERVER[PHP_SELF]; ?>" method="post"><textarea cols="50" rows="50" name="content"></textarea><input type="submit" name="submit" /></form><?phpif (isset($_POST[submit])) {mysql_query("INSERT INTO table (content) VALUES ('$_POST[content]')");}echo 'File content saved';?>
  4. imrie

    need help!

    Yes, you can create such a feature. You should look into -PHP file handling, in particular fopen , fread , fwrite.
  5. Yes, would change them as they are just text right now.
  6. Here's what i have been working on so far, it needs something... but i don't know what...? Is it to flashy for old browsers? its only CSS and HTML so far.Click here to view siteAny suggestions appreciated,Thanks,
  7. The site would be computing related, so i think it should be viewable by a reasonably up-to-date browsers, although you could say w3schools is computing related, therefore, i should perhaps simplify the site to an older browser compatible website. What do you think of the color choice?Thanks,
  8. Hello,I am making another website, this website is an educational website that must be easy to read, easy to navigate and look stylish. However, i am not sure where the "boundary" is. I don't know whether to go for all out CSS2 bit of JavaScript and Ajax. Will there be a high percentage of users whose browsers can not handle such technologies. And should i stay to conventional "older" code where everyone will be able to use, because in my books doing this would sacrifice the look and feel of the site.Color choice, i need a 2nd opinion on my color choice for such a website, i was thinking of the following color palletes from http://kuler.adobe.com, the Sandy Stone or the 28X Dusty Petrol.Round Boxes? or Regular Boxes?Think of this as a "customer survey", what would you prefer?, what do you suggest?Many Thanks,PS. Apologies if this is the wrong section, didn't see where else i could post this.
  9. imrie

    forums

    Creating your own forum is a major project, it is of course very possible. You will need a MySQL Database to store information like; posts,users,threads etc. If you are really new to this, there are a lot of Forum Software's that you can install on your server which would produce what you are after. I recommend SMF , simplemachines.org.
  10. You are missing a bracket ) .You have -if (isset($_COOKIE["username"]){It should be -if (isset($_COOKIE["username"])){
  11. I think that would need to be done with JavaScript or an other client-side lanugage that can interact with a clients command. The code i posted will process the information once it is has been submitted, this is server-side.
  12. Alternatively, if you didn't want to use a third party app. If i wanted to add bold and italic functions etc. I would do this - /* Say you had content like this - Hello [b]World![/b] [i]this is a WYSIWYG[/i]*/$feedback = $_POST[feedback];//Search and replace for [b]$step1 = str_replace("[b]", "<strong>", $feedback);//Search and replace for [/b]$step2 = str_replace("[/b]", "</strong>", $step1);//Search and replace for [i]$step3 = str_replace("[i]", "<i>", $step2);//Search and replace for [/i]$step4 = str_replace("[/i]", "</i>", $step3);// Parse the line breaks$finish = nl2br($step4);//Then just insert it to db See if that works, never made my own WYSIWYG.
  13. Use the nl2br() function, this parses line breaks.So - $content_br = nl2br($POST_[feedback]);
  14. imrie

    Parse Error

    This is defining variables:$dogname = trim($_POST['dogname']);$dogbreed = trim($_POST['dogbreed']);$doggender = trim($_POST['doggender']); You had defined them.
  15. imrie

    Parse Error

    Have you defined the variables?
  16. imrie

    registering

    When you say have the members stored in signup.php, are you using flat files or a database? or you looking for help ceating a registration script?
  17. imrie

    new to php

    Well, i think the hashing of the password is a neccersary feature. This will encrypte the passwords in your database. It is very easy to use. On your login script you could do this: <?php/*Notice here you are defining the passwordinputed by the user > encrypting it and usingthe encrypted password as a variable too. */ username = $_POST['Username'];$password = $_POST['Password'];/* Hash the password for security */$pass_hash= md5('$password');/*Then you can do your query'ng heremake sure to select with the $pass_hashas this is what is saved in your table */?> You might want to add the mysql real escape string to the above also the mysql_free_result read here For the date of birth you could do this -you can read more here. /* create a form */Please enter your year of birth -<form action="agechecker.php" method="post"><input type="text" id="id" name"age"></form>/* Lets say the age limit is 20ie 20 years back from now in 1987.The user must enter 1987 or below to gainaccess. */$user_year = $_POST['age'];$default = 1987;if ($user_year > $default) { echo "You are too young to use this website";} elseif ($user_year <= $default) { echo "Age allowed <a href="www.yourwebsite.com/registrationform.html> click here to continue </a>;} else { echo "Error - please input your year of brith, <a href="www.yourwebsite.com/ageform.html> back </a>"";}/* This will take into account the yearonly and not the month or day. */ Good Luck! with your new website.
  18. Well i personally use $variable. Create a php info file to find out about register_globals , my server config has this set to off and i can still use $variable.
  19. <div id="test"><a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading3.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading3.JPG" /></a></div><img src="blank.jpg" name="image" onclick="document.getElementById("test").setAttribute("rel", "lightbox")" /> Would this work ok?
  20. imrie

    new to php

    If its a registration system code your after i can help you out there. <?php$link = mysql_connect('mysql4.freehostia.com', 'Name, 'Database Password') or die('Could not connect: ' . mysql_error());mysql_select_db('Database Name') or die('Could not select database');$username = mysql_real_escape_string($_POST['username']);$password = mysql_real_escape_string($_POST['password']);/*encrypted password*/$password_hash = md5($password);$check = mysql_query("SELECT * FROM users WHERE Username='$username'");if (mysql_num_rows($check) == 0){ mysql_query("INSERT INTO users (Username, Password) VALUES ('$username', '$password_hash')");}else{ echo "already taken";}/*security procedure*/mysql_free_result($check);mysql_close($link);?> I changed the script to encryprt the password and insert the encrypted password to the database. For the hashing i used md5(), you might want to read up about that. I also added a bit of code to help prevent SQL injections.
  21. Do i need to put this in a function at the top of the page? And how would you activate it, does it go in a a href or image tag?Thanks,
  22. can you provide an example of how to use the object.setAttribute?Thanks,
  23. Would i add that to the the: <img class="pos_left" style="LEFT: 124px; WIDTH: 447px; TOP: -475px; HEIGHT: 358px" alt="" name="mainimage" src="blank.jpg" /> line or the individual lines?
  24. Hello,hereI am new to world of JavaScript and i would like some help in a script i am creating. Right now it is complied of a script from here and i would like to intergrate Lightbox into it.What i want to happen is: as you can see when you click on one of the images it appears in the center box (skewed to fit), i would like that when you then click on the image in the main box for it to open in lightbox from. (this is done by adding rel="lightbox") And the image to now open like that.The coding: <!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> <title>Untitled Page</title> <style type="text/css">img.pos_left{position:relative;left:-20px}</style><script type="text/javascript" src="lightbox.js"></script><script LANGUAGE="JavaScript"><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com --><!-- Beginfunction changeImage(filename){ mainimage.src = filename;}// End --></script></head><body><p> </p><p><table height="103" cellspacing="1" cellpadding="1" width="31" summary="" border="1"> <tbody> <tr> <td style="WIDTH: 109px"> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading6.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading6.JPG" /></a></td> </tr> <tr> <td style="WIDTH: 109px"> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading5.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading5.JPG" /></a></td> </tr> <tr> <td style="WIDTH: 109px"> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading.JPG" /></a></td> </tr> <tr> <td style="WIDTH: 109px"> <a href="java script:changeImage(http://www..com/cpg1412/albums/archivest/spreading6.JPG' "><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_finish.JPG" /></a></td> </tr> </tbody></table><table cellspacing="1" cellpadding="1" width="200" summary="" border="1"> <tbody> <tr> <td> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading3.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading3.JPG" /></a></td> <td> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading4.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading4.JPG" /></a></td> <td> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/harrow.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_harrow.JPG" /></a></td> <td> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/spreading2.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_spreading2.JPG" /></a></td> <td> <a href="java script:changeImage('http://www..com/cpg1412/albums/archivest/harrow3.JPG')"><img alt="" src="http://www..com/cpg1412/albums/archivest/thumb_harrow3.JPG" /></a></td> </tr> </tbody></table><img class="pos_left" style="LEFT: 124px; WIDTH: 447px; TOP: -475px; HEIGHT: 358px" alt="" name="mainimage" src="blank.jpg" /> </p></body></html> Another thing would be to make the script not skew the image, so that when you click on an rectangular image its not stretched into a square.Your help is very much appreciated!thanks,
×
×
  • Create New...