Jump to content


  • Posts

  • Joined

  • Last visited

Previous Fields

  • Languages
    x(html), css, php (learning)

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
  • Interests

danm68's Achievements


Newbie (1/7)



  1. Try posting in the xslt forum? (If you haven't already)
  2. danm68

    Php Projects

    login system, expand it to user management. Feature-ise away
  3. For starters to see all your $_POST data: echo "<pre>";print_r($_POST);echo "</pre>"; The <pre> tags are just so you can view the POST data easier.So to check if the hidden value is sent with the POST data, you can do an if statement like so: if(isset($_POST['submitted'])){ //Form was sent, execute code in these brackets. //eg. set variables to $_POST data.}else{ //Form was not sent // set variables to database values.} (If you aren't already, just name the submit button, and check the name. ($_POST['submitName'])Forgive me I understood this wrong, but basically if the form was not sent you want to pull information from a database, but if the form is sent you want to use $_POST information?If so, try this: if(isset($_POST['ageing[0]')){ $info = $_POST['ageing']; //swap the form name for the quoted writing.}else{ $info = //some database entry} If this isn't what you wanted please explain more.
  4. danm68

    Logging System

    That would be handy.But as a starting point: logging this in a text file and using arrays. You might want to look at a function called file().It reads out each row as an array.dbase.txt:row1 cell1 |&| row1 cell2 |&| row1 cell3row2 cell1 |&| row2 cell2 |&| row2 cell3row3 cell1 |&| row3 cell2 |&| row3 cell3 somephpfile.php: //add code checking if file exists, to stop errors when trying to open...$data = file('dbase.txt');//$data holds this info//$data[0] = row1 cell1 |&| row1 cell2 |&| row1 cell3//$data[1] = row2 cell1 |&| row2 cell2 |&| row2 cell3//$data[2] = row3 cell1 |&| row3 cell2 |&| row3 cell3//use explode for each line.foreach($data as $key => $val){ $data[$key] = explode("|&|", $data);} After this the array would correspond to your dbase.txt file like this: row1 cell1 |&| row1 cell2 |&| row1 cell3 row2 cell1 |&| row2 cell2 |&| row2 cell3 row3 cell1 |&| row3 cell2 |&| row3 cell3$data[0][0]|&|$data[0][1]|&|$data[0][2]$data[1][0]|&|$data[1][1]|&|$data[1][2]$data[2][0]|&|$data[2][1]|&|$data[2][2] I used '&' as part of the separator because if you encode the input (if you plan on storing user input) then you can encode the ampersand so that your database never breaks.. I did use double pipes but found they broke if I put in a code example such as = if(x||y)Useful functions might be: htmlentities() - prevents javascript injections etc. trim() - remove unnecessary spaces. and use the following if you want to preserve layout of text by using html line break tag <br /> $linebr=array("\r\n", "\n", "\r"); //should work for all types of line breaks? $input = str_replace($linebr,"<br />", $input);$input being the users submitted data in a variable..
  5. Hahaha, that's gold.I've never thought of using javascript like that. Kinda forgot that you can link to external files.
  6. What's more important? The information, or the twitter posts?My eye's immediately went to the twitter posts.As skemcin said, separate it, and maybe smaller text?More spacing!I think the larger the text, the more space you want. (List just before the bottom of page)And the top of your footer feels a little close, and separate the links as well.
  7. Maybe a different shade of green for the top?Looks ..funny.. to me.I like your version 3 .And definitely a home link on the gallery.Otherwise looks nice.
  8. danm68

    I'm Confused About It

    Admiring the patience shown here. Use a USB.Maybe read DD's post?
  9. I remember when I made my first mock site with php (not that long ago..) I got the layout working/ looking how I wanted it, and converted pieces to php as I went. (Basically your second suggestion) ie: Changed basic navigation to a dynamic navigation, loading different links depending on which directory you are in. Changed "Calendar here" text for an actual calendar. Created login pages that worked with forms already in place, and displaying username on pages if you were logged in.blah blah you get the idea. But if you can I would save your pages as .php extensions, because that way if you want to include php you don't have to rename files. Just add the php delimiters and away you go.
  10. You should know that this wasn't made using just html. That would be suicide. It uses PHP. Check out the tutorial if you're interested.PHP generates things dynamically. That site would have a database holding all those items, and the PHP would display them on the page. Whoever made that page did not type out line after line in just html.When you say 'How many pages does this site contain?', if you only count the links on the side, and the products on the main display, only 2 pages.If you look at the link in the status or address bar, the name of the page is the part before the question mark '?'.index.php?cPath=32 (index.php)The part after the question mark is as chibineku said, information sent to the server to allow it display the correct information from the database.and the other page is..product_info.php?products_id=120 (product_info.php)This is a link for an individual item, and once clicked you see product information (product_info.php) about product number 120 (?products_id=120).Changing that single number changes the product you will be looking at, but the page is actually the same, it just displays different information dynamically.If you are interested in this stuff, learn php and ask some questions on the PHP forum.
  11. http://edrackham.com/apache/beginners-mod_rewrite-tutorial/Mod rewrite tutorial for you. Hopefully it covers what you want to know.
  12. Or, if you're interested in a method that does not use javascript, only css and html, then check out this: http://meyerweb.com/eric/css/edge/menus/demo.htmlSuppose you could call it a 'dropdown' or 'fly-out' menu.The only problem with the css menu, is that it won't work in Internet Explorer. I think it works in most others? (Firefox, Chrome, Safari, Opera)Correct me if I'm wrong.And that for the submenu to display you rely on keeping the mouse over the menu, so your links can't be too small.Obviously javascript has an advantage with just clicking to keep a submenu active.
  13. ingolme's method is good. Further reading: http://www.alistapart.com/articles/flashsatay
  14. Password protected seems a bit much work for something that you are going to unveil anyway.Why don't you: use Synook's suggestion. use CSS: form{display:none;} or form{visibility:hidden;}, this way no one can see the form and submit anything, (unless they view page source or edit it with firebug or similar) place html comments around it (same issue as above), or place php comments around the form output so the html code is never sent. make another input element, and in your php register code, if that value is not equal to a certain number or string, then don't run php register code. Kind of like a captcha or anti-spam for comments...OK, just re-read your post... ...so it sounds like you don't want just anybody to be able to register, but maybe have people with passwords so they can test it out or something??Anyway, if you don't want to use any suggestions above. Here's some really basic code.On your register page, add this inside a php block (adjust php delimiters accordingly). <?phpif(empty($password)){ $password = '';}if($password == '' && isset($_POST['p'])){ $password = md5($_POST['p']);}else{ $password = '';}if($password == '5f4dcc3b5aa765d61d8327deb882cf99'){ //register code in here.}else{ ?> <form action="" method="post"> <input type="password" name="p" /> <input type="submit" value="Log in" /> </form> <?php}?>OR<?phpif(empty($password)){ $password = '';}if($password == '' && isset($_POST['p'])){ $password = md5($_POST['p']);}else{ $password = '';}if($password != '5f4dcc3b5aa765d61d8327deb882cf99') //md5('password');{ header("Location: http://yourwebsite.com/some-other-page.php"); exit; // no code should run after redirect.}?>[/code]The second code allows you to place it above the register code, and not worry about anything else, whereas the first one you should paste your register code inside the corresponding braces.And if you wanted, change all $_POST variables to $_GET, and change the method of the form to "get", and this way you could bookmark the page so you don't have to type in the password all the time. Only downfall is the password is in clear text in the url.
  • Create New...