Jump to content

aleksanteri

Members
  • Posts

    130
  • Joined

  • Last visited

Posts posted by aleksanteri

  1. You could use:

    <html><head><script type="text/javascript">function comment_timeout(){   setTimeout("document.getElementById('comment_form').submit()", 100*60*3);}</script></head><body onload="comment_timeout()"><form id="comment_form" action="submitcomment.php"><!-- some inputs --></form><p>Your comment will be automaticly submitted in 3 minutes.</p>

  2. Found your mistake.

    <html><head>  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  <meta http-equiv="Content-Language" content="en">  <meta name="Author" content="Sniffy Gerbil">  <title>Welcome to Bobville!</title>	<link rel="stylesheet" type="text/css" href="stylesheet.css"></head><frameset cols="120,*, 120" border="0">	<frame src="http://bobville.1500mb.com/menu.html" name="navigation" scrolling="no" noresize="noresize">		<frameset rows="100,*">			<frame src="http://bobville.1500mb.com/header.html" name="logo" scrolling="no" noresize="noresize">			<frame src="http://bobville.1500mb.com/index2.html" name="main" scrolling="auto" noresize="noresize">		</frameset>	<frame src="http://bobville.1500mb.com/link.html" name="rightside" scrolling="no" noresize="noresize"></frameset><noframes><body>Your browser does not support frames!</body></noframes></html>

    The error was that you had <frameset> inside the <body> element. <frameset> should be considered in the same priority as <body> and <head>.This is wrong:html head /head body frameset /frameset /body/html... and this is right:html head /head frameset /frameset body /body/htmlGahhh, looks like someone got me first.

  3. Well that could work... but if the owner has 3+ pets?You should create a span area and every time when clicking on a button, it adds a control to the span area.I could write the code for you but I can't get it working. However, I found this page that has the code you need.

  4. Just came in mind that you could use VBScript to format the message box.

    <html><body><?php print("<script type=\"text/vbscript\">msgbox(\"Warning, your computer hasn't allocated enough memory to display this message box. Click OK to continue\",16,\"Warning\")\n</script>");</body></html>

  5. Yeah, for constants though I use uppercase.- variables lowercase

    $myvar; $anothervar

    - functions (including built-in) lowercase

    checkpass(); print();

    - constants uppercase (as I mentioned above)

    define("TEN_BY_TEN", (10*10)); $hundred = TEN_BY_TEN;

    - keywords lowercase

    if($x == 5) print("\$x is 5");

    - operators if in letters

    copy($file, $dir) or print("Couldn't copy $file"); if($x == 5 and $y == 5) print("Both \$x and \$y are 5");

    I also have a habit of having print() having parenthenses. I never use echo but if I would it wouldn't have semicolons as PHP Group wrote in their manual that echo is more a statement instead of a function and print is more a function instead of a statement. My habit has all functions having parenthenses and statements have only if required.

  6. If he wants to pass arbitrary POST data to another page, including arrays or binary data, he's going to want to keep it in the session.  It's the easiest way in my opinion, you don't have to manage any files and you don't have to worry about URL-encoding or validating any data.

    I agree, sessions are a good thing in PHP, I didn't just know there is a special variable like _SESSION["var"]. I was registering ALL my variables when I was testing a login script! :) (actually I had only two of them, one for username and one for password)Usernames and passwords in a login script needs to go with "POST" for security reasons. I remember one page with a login script with "GET". Were they mad? I logged in one time and came never back. :)
  7. Oh? Why my @&£$*! book didn't tell me about destructors then?
    Only PHP 5 has destructors, PHP 4 does not.

    All right, I checked my @&£$*! book, it was teaching me PHP 4. :)Good I did download the latest version of PHP (v.5.1.2)
  8. I tried notepad2...the highlighting didn't do as much for me as I thought it would.I make good comments and space my code nicely and found that the highlighting didn't make it any easier to read.oh well I'll stick to notepad.

    I have been using Notepad2 for a long time... I used to do it with Notepad (original) and when I got Notepad2 (it was on some computer CD), I began using it and never looked back anymore :) Although it has some errors. It doesn't see <embed> as a real tag, and attribute runat is not a real attribute.Oh well, it is still the best I have (and it is so familiar to me :) )
  9. 15. Someone told me that using isset to pic up information on whether a form was submitted or not does not always work and it's better to use if ($_POST['whateverbuttoniscalled'] == "")instead of if (isset($_POST['whateverbuttoniscalled']));is this true or was he just a dumbass, that needed to re-learn php, the reason I ask is because this is the way I learnt and he criticized me for it, also he disagreed that register_globals being on was not a security issue, I went past him to his boss, and talked him into changing the server's anyway. Where does he get those kind of ideas(sorry partially ranting, and raving::And no I amnot a girl I am a guy, I just get pissed something:::')
    $_POST[$var] is the special variable with $var as the query (same as the name attribute on the form input). The isset keyword function returns true when the variable is set posted, like on a page www.somepage.com?query=value, isset(_GET["query"]) would return true, but isset(_GET["secondquery"]) would return false. You can use this by:
    if(isset(_POST['var'])){	// code to be run when var has been posted within the form}if(!isset(_POST['var'])){	// code to be run when var has been not posted within the form}

  10. You can also have a destructor that gets executed when the instance gets deleted.
    Oh? Why my @&£$*! book didn't tell me about destructors then?Well, thanks. :)
    target tag is deprecated in Xhtml strict, but I use it, simply choose transitional if you choose to use it, I always go transitional, because theres no other way to open new windows except with javascript, and too much trouble, just a note.
    So it is after all? :) I was so used of using XHTML Strict
  11. You probably mean JavaScript. Java is quite different from JavaScript, while Java is not a programming language for the internet at all, and JavaScript is :)

    Java can be used in internet, in the applet form. Java can be run by any major browser I know (IE, FireFox, Opera).
    can i sent variables/other info from java to php?If yes: howI just want to send the score of the player in a java game (made by me of course) to a php page (coocies?)

    I do quess Java can handle cookies. How, that I don't know (I'm not a Java-master-expert though! :) )Check this out BTW.
  12. AHHHH.. c..c...code so wrong!  :) You have like 5-10 things wrong, you need to move away from javascipt and learn php :blink:heres the list of what you did bad :)
    • To make a variable you dont need to put var $link. Its just $link
    • The target="_blank" jas been deprecated..
    • To call a function you dont put new functionname() in front of it, if you do please correct me.
    • The class and a function in it are named differently, mabye this is where you messed up on the new funtionname() part.To create a new class you would put new classname, to call a function in it you would do *thinks* you know what, im just going to rewrite the half of it :)
      <html><head><style type="text/css">body{font-family: verdana}a, a:visited{color:#00f}a:hover{background-color:#408}</style></head><body><?phpclass WWWLanguage{public $name;public $link;private $description;private function Language($name, $link, $description){ $this->name = $name; $this->link = $link; $this->description = $description;}function displayLanguage(){ echo '<p><a href="http://www.w3schools.com/$this->link">$this->name</a><br />\n'; echo '$this->description</p>\n';}}$html = new WWWLanguage$html->name = "HTML";$html->link = "html";$html->description = "The basic WWW building language.");$vbs = new WWWLanguage("VBScript", "vbscript", "ASP's default scripting language");$vbs->name = "VBScript";$vbs->link = "vbscript";$vbs->description = "ASP's default scripting language";$js = new WWWLanguage("JavaScript", "js", "The most common scripting language");$js->name = "Javascript";$js->link = "js";$js->description = "The most common scripting language";$php = new WWWLanguage("PHP", "php", "The best serverside scripting language in the world!");$php->name = "PHP";$php->link = "php";$php->description = "The best serverside scripting lagnuage in the world";if($selection == "html"){$html->displayLanguage();}elseif($selection == "vbscript"){$vbs->displayLanguage();}elseif($selection == "javascript"){$js->displayLanguage();}elseif($selection == "php"){$php->displayLanguage();}else{echo "please select a language!";}?></body></html>

    Oh?
    [*]To make a variable you dont need to put var $link. Its just $link
    I learned PHP from a book from the library, it says that to execute code straight, you need to make a method with the name of the class. It also says that you need to use the var keyword in variables in classes. It does still say that you don't need the var keyword outside the class... I just checked the http://www.w3schools.com/tags/tag_a.asp page, if target="_blank" would have been deprecated it would have been written there.I want to execute just the first function and the displayLanguage() after.Besides all, I have tested this out and noted it works. :blink: BTW, what's the difference between public and private variables?
  13. Then it should be like:

    foreach($array as $val){if (empty($array)) // check that it is not empty{echo "array position " . $i . "is filled with " . array[$i] . " <br />";}}

  14. I like PHP objects, you can create multiple instances. Especially the methods is a feature I like.

    <html><head><style type="text/css">body{font-family: verdana}a, a:visited{color:#00f}a:hover{background-color:#408}</style></head><body><?phpclass WWWLanguage{	var $name;	var $link;	var $description;	function WWWLanguage($name, $link, $description)	{  $this->name = $name;  $this->link = $link;  $this->description = $description;	}	function displayLanguage()	{  print("<p><a href=\"http:\\\\www.w3schools.com\\$this->link\" target\"_blank\">$this->name</a><br />\n");  print("$this->description</p>\n");	}}$html = new WWWLanguage("HTML", "html", "The basic WWW building language.");$html -> displayLanguage();$vbs = new WWWLanguage("VBScript", "vbscript", "ASP's default scripting language");$vbs -> displayLanguage();$js = new WWWLanguage("JavaScript", "js", "The most common scripting language");$js -> displayLanguage();$php = new WWWLanguage("PHP", "php", "The best serverside scripting language in the world!");$php -> displayLanguage();?></body></html>

    A class with a method with a name same than it's parent class does execute the method immediatly (what is demonstrated at the code above) :)

  15. Here is the valid code in syntax... but I didn't know you can have empty arrays. (no wonder, I just got my PWS support PHP) :)

    for($i = 0; $i <= SomeFunctionThatTellsTheCellAmount; ++$i){if($arr[$i] != "") // check that it is empty{$i++; // lets do next...echo "array position " . $i . "is filled with " . array[$i] . " <br />";}}

    I dunno does this work but have a try.

  16. Make sure that you give the directory you want to run your PHP files from Execute permissions.  You should have permissions for read, write, and execute, make sure your PHP directories have the execute permission.  I've never used PWS, so I'm not exactly sure how to configure that, but see if you can find it.

    I have *.asp and *.php files in the same folder.The folder has given full rights.When I open an ASP file, the file executing works just fine.When I open a PHP file, I get an 403.1 error. :)--------------------------------------------------------------------EDIT: Heeey, wait now... :blink: I checked my virtual folders, there was another folder with the same path, and the cgi-bin with no rights!!!! Ok, I gave all folders full rights (this is localhost) and my PHP works!!! :):) Wov, av-3274.jpgROCKS!!!!
  17. I mean that I get a 403 error when I'm opening a PHP file via PWS, which works with ASP. It says that I need to give rights to run the PHP in PWS. How do I do this?

  18. First off I would like to know how on this site justzelda.zeldacentral.net I would bring the affilaties list on the right side to the top underneath the button. second what is the coding for having one button/image and then when you put your mouse over a link somewhere on the page the button/image will change to one that suites that link?
    I don't understand the first question.If you want to have animated images, here is the HTML code.
    <html><head><script type="tex/javascript"><!--var firstImg = ImageFilename1 // image to display by defaultvar secondImg = ImageFilename2 // image to display when the cursor is on top of buttonfunction rollOver(id){document.getElementById(id).src = secondImg}function rollOut(id){document.getElementById(id).src = firstImg}// --></script></head><body><a onmouseover="rollOver('myImg')" onmouseout="rollOut('myImg')"><img src="SameImageThanOnImageFilename1-VariableAtTheScript" id="myImg" /></a></body></html>

    This code is handy if you have multiple images with the same src. You just need to change the 'myImg' part. Note that the id at "rollOut('here')" needs to match the image's id. The onmouseover and onmouseout attributes must also be in the <a> tag because the <img> tag does not support mouse events!

×
×
  • Create New...