Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. <!-- @import url(layout/style.css); --> <style type="text/css"> should be: <style type="text/css"> @import url(layout/style.css);
  2. while (!feof($pfile)) note the !
  3. I have been wondering this myself I have some see use: md5($password . 'chocolate') although I doubt this is really secure as the total length is lower then the MD5 output length and therefor more easy to crack? Personally I use sha1( sha1( $password ) . sha1( time() ) ) any advice?
  4. Then it is most presumably that PHP isn't installed or an incorrect extension (.html instead of .php) as PHP then is recognized as HTML due to the < and > and therefor hidden. Right click on your web-page and select View Source and go through it you'll find: <?php .. ?>
  5. That's due <form action="#" method="POST"> modify # with the URL and remove the <form> tag you used after the <body> tag
  6. You must note that the above code will fail when someone tries to register with an already existing e-mail address. MySQL returns a specific error code for this, figure it out and act accordingly otherwise people will just see: "Could not register because " and that makes little to no sense to them.
  7. My code served as an example, it needs editing for it to work. background: url(path/to/background/image.fig); <-- put here your path to the actual background image Also change the width's and height's as I have them now specified to 400x400 for the wrapper 200x150 for the form. Also the #content margin-top and margin-left is the half of the width and height of the form
  8. I think he has problems understanding the difference between a class and an object. The most common explanation they give, and in most cases gets the point across is that you can compare it to a blueprint of a house and a house itself respectively a class and an object. In simple terms: an object is created using the class as a blueprint.
  9. You ask the user to input the Video ID (xFYQQPAOz7Y) afterwards when you want to display the video you do: <object width="480" height="385"> <param name="movie" value="http://www.youtube.com/v/<?php echo $vid; ?>"></param> <param name="allowFullScreen" value="true"></param> <param name="allowScriptAccess" value="always"></param> <embed src="http://www.youtube.com/v/<?php echo $vid; ?>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"> </embed> </object> Personally I would extend this further so I could control which video had fullScreen and scriptAccess, the width and height of the video.
  10. Try if ($_SESSION['auth'] == 'yes') { echo " For the User : {$_SESSION[user]} <br> Your Reservation time start in : {$_SESSION['Time'] }"; } else { echo ' Not defined'; } What does that output?
  11. I ain't rude, I said thank you twice
  12. I am well aware of what the query() method returns, thank you. And I am also more then familiar with the PHP.net manual, thank you. I just copy-pasted the wrong class name earlier.
  13. ignace

    key=

    Instead of key2, key3 you can use: ?key[]=value&key[]=value&key[]=value or ?key=value1,value2,value3
  14. if (!empty($_POST)) { //process if ($insertSuccess) { header('Location: ' . $_SERVER['SCRIPT_NAME']); exit(0); } } After the user submits the form you process it, and you redirect them to the same page. If you now refresh the page FF does not asks you. Edit: MrAdam beat me to it.
  15. All HTML code is meant to go in the <body> tag. The CSS should be linked in the <head> section. The above code creates a div#wrapper that contains the blue background image, the div#content contains the actual form with the input fields. The div#wrapper is horizontally centered across the view-port (everything below the tabs and above the status-bar); div#content is centered both horizontally and vertically I use negative margins to have it slide back up and move to the left as it otherwise would render in the 4th quadrant of the box.
  16. The method query() returns a MySQLi_STMT object, num_rows is a property that contains the number of rows by the last executed query.
  17. <object width="480" height="385"> <param name="movie" value="http://www.youtube.com/v/xFYQQPAOz7Y"></param> <param name="allowFullScreen" value="true"></param> <param name="allowScriptAccess" value="always"></param> <embed src="http://www.youtube.com/v/xFYQQPAOz7Y" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"> </embed> </object> All you need to ask from the user is xFYQQPAOz7Y through the YouTube API you can ask if it's a valid YouTube Video. http://code.google.com/intl/nl/apis/youtube/overview.html
  18. <?php // Make a MySQL Connection mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("wars") or die(mysql_error()); // Get all the data from the "example" table $result = mysql_query("SELECT ul2 FROM s1units") or die(mysql_error()); if (false !== $result) { $row = mysql_fetch_assoc($result); $ul2 = $row['ul2']; if ($u12 >= 3) { echo 'Have a nice weekend!'; } else { echo 'Get back to work!'; } } ?>
  19. Wherever that code came from put it back as it will cause more trouble in the future. Just see what happens when I pass: ?page=../../index
  20. QA #1 Yes, you will need those patterns but not in the way I envisioned. For an example implementation I advice you to take a look at the link I provided in my previous post (Zend framework). QA #2 Your menu and your controller hierarchy are completely decoupled, they have no business with each other. Plus, your menu can also contain external links. Therefor it would be best to store your menu hierarchy in a database table, read out the table and build the menu. Apply logic to indicate active items.
  21. Here's an example of how you would normally do it, fill in accordingly. Please note, extra style-rules may be required. <div id="menu"> <ul> <li><a href="#">Item #1</a> <ul> <li><a href="#">Item #1.1</a></li> </ul> </li> <li><a href="#">Item #2</a> <ul> <li><a href="#">Item #2.1</li> </ul> </li> </ul> </div> #menu li a { display: block; background-image: url(path/to/image.fig); } #menu li a:hover { background-image: url(path/to/image-hover.fig); } /** SUB-ITEM *************************************/ #menu li li a { background-image: url(path/to/alt/image.fig); } #menu li li a:hover { background-image: url(path/to/alt/image-hover.fig); }
  22. You are mixing Controller & Model logic, and I was on the right track in my second post. You basically want to build the navigation menu and mark certain items as active. Take a look at an example implementation over at Zend framework.
  23. By dynamically expand I mean to balance all columns, each column will contain the same number of items as the other columns. No column has a limit, so each column may contain up to 25 and more items. It has also a disadvantage to hide data when the number of items in the database is not a product of 4. For example when the database contains 7 items only the first 4 are shown, as it would otherwise unbalance the columns. If you however only want to show 10 items in each column at any given time then you could use LIMIT 40
  24. Depends on what you want to do with it. Currently it does nothing, so a <UL> would be better, you can use JS to limit the number of players that are shown.
×
×
  • 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.