Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Almost usually... there is at least one mod active in the forums through the day. It is the weekend though and I noticed some of them sometimes rarely appear in the weekends. I noticed that most, the 3 we usually see, are mostly active on here during the weekdays though.
  2. It's usually because when using document.write, it basically makes a new document. So in your case, what it's doing is making a new document and printing the first value in the array, John thus why you only see John but some browsers may display all values in the array.
  3. Don E

    Select

    Yes, PHP is a server side language.
  4. This probably will help ya: http://www.w3schools.com/jsref/met_win_confirm.asp
  5. Don E

    help :(

    Hey Snakes, I was able to add up the following like so: <!DOCTYPE html><html><head><script type="text/javascript">function sum(){ var result = 0; var answer = [1,2,3,4]; for (var i=0; i<answer.length; i++) { result = answer[i] + result; } alert(result);}</script></head><body><button onclick="sum();"> addition</button></body></html> Instead of document.write I just alerted the result and used a regular for loop. Hopefully this helps.
  6. Welcome to the forums. Looks like you're missing some concatenation operators here: $message = "Name: " . $name "\n Email: " . $email "\n Subject: " . $subject "\n Message: " . $message ; Try this: $message = "Name: " . $name . "\n Email: " . $email . "\n Subject: " . $subject . "\n Message: " . $message ;
  7. I believe he mean't this: http://w3schools.com/jsref/tryit.asp?filename=tryjsref_gettime
  8. Don E

    Security

    I just thought I'd post this here to those who may be interested in capturing unexpected file requests to their website: http://w3schools.invisionzone.com/index.php?showtopic=43993
  9. Something like the following rewrite rule would take a link on your site, for example.. <a href="services" title="Services">Services</a> and display the appropriate page which would be services.php RewriteRule ^([a-zA-Z]+)/?$ $1.php [nc,l] So if you're trying to make form.php only have the word and no .php to it, you have to have the href for the links just contain the word for that particular page. So <a href="about" title="About">About Us</a>, when clicked on this link and if you contain a file called about.php where your .htaccess is at, it would display the about.php page but in the URL address bar for the browser, it will display something like this: http://www.site.com/about Hope this helps.
  10. Is PHP displaying any errors? With header(), you can just do this if you want: header("location: admin.php?id=row['id']"); If you were using single quotes, then the way you had it should be okay. ie header('location: admin.php?id=' . row['id'] );
  11. Fox, Speaking of "share" button(s), what is the route that most developers do in order to accomplish this? I basically see this with facebook but I'm not much of a user of facebook to really know how it works. In other words, I never really clicked on any share buttons anywhere. I just noticed them on the forums here and most go to social media websites, is this the "share" you're referring to? I take it the social media sites supply information for you on how to set up the 'share' buttons for your site for example? Thanks.
  12. Don E

    error help

    Try this by removing the PHP tags because since you're echoing to begin with, it looks like you have opening and closing PHP tags already established for this particular page or segment of code for that page. echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
  13. Don E

    error help

    This is the way I understand how it works procedural style: $result = mysqli_query($dbconnection, "SELECT * FROM table"); $rows = mysqli_num_rows($result); $rows should then contain the number of rows.
  14. Because since that is the first if in the if else if else conditionals, 'a' which is 27 is greater than 'b' which is 13, which is true and you're returning a. JS has a built in max function: http://www.w3schools.com/jsref/jsref_max.asp
  15. So Called, Is the method above more suggested or would ErrorDocument also suffice(like what you mentioned in post 7)? It seems like they would basically do the same thing, but with ErrorDocument you would have many of these for example in the .htaccess: ErrorDocument 401 /error_pages/401.htmlErrorDocument 404 /error_pages/404.htmlErrorDocument 500 /error_pages/500.html Also, with the way you're showing niche, we can also rewrite rule to an error.php(for example), display an error but at the same time log all necessary info about the request? Thanks.
  16. Nice thread. RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . / Does the above basically mean.. if the requested file name is not a file you have and/or the requested directory is not a directory you have, then go to index.php? (just clarifying; not too familiar with htaccess conditionals) Thanks.
  17. Yes, my mistake.. I forgot to quote that in my example. It should be $row['id']; within the while loop. Correction: while ($row = $result->fetch_assoc()){ echo '<a href="display.php?id='. $row['id'] . '">something here</a>';}
  18. I think scientist is saying instead of this: $query = select from disdis(dis_name, dis_that, dis_this, dis_date order by dis_date(date, %m %d %y) desc where $id=id) or die('did not work grrrrrrrr'); Change it to this: $query = select from disdis(dis_name, dis_that, dis_this, dis_date order by dis_date(date, %m %d %y) desc where id=$id) or die('did not work grrrrrrrr'); I believe that's what he meant when he said it seems you have it backwards. I also noticed you forgot to surround the query in quotes?(Just mentioning) Yes you can grab the id's automatically and place them in the links within the while loop: $mysqli = new mysqli("localhost", "my_user", "my_password", "db");$result = $mysqli->query("SELECT id FROM table"); while ($row = $result->fetch_assoc()){ echo '<a href="display.php?id='. $row[id] . '">something here</a>';}$mysqli->close(); Then on the display.php page, use $_GET to retrieve the id and then use it to query the database table. $id = $_GET['id']; $query = "SELECT product_title, product_descrip WHERE id = $id"; // just an example
  19. Anything within parentheses from what I understand has the highest precedence.. This apply to the example above?
  20. Fox, When you say the name attribute of the form element is not valid and depreciated, and not the proper way to access forms, is this based on what's considered good coding practices or something else? I noticed for HTML5, the name attribute for the form element is still available. http://www.w3schools.com/html5/tag_form.asp Thanks.
  21. Remember though... with all the if, elseif's, only one can be true, if none are true, then the else will be executed: if(){ }elseif() // for example: if this one is true, this gets executed and the ones below are not checked{ }elseif(){ }else // if none of the above are true, then this gets executed{ }
  22. I believe those that said they wouldn't pay for it is because they can make their own sites, but imo, I can see someone who doesn't know how to make websites at all pay for that.
  23. Hey everyone, When a file that is being uploaded is larger than the upload file size allowed and the post max size in the php.ini, what is suppose to happen? Because when I test this, the status bar shows the file being uploaded(Chrome for instance shows the percent) and then once it's done, the page.... what it looks like is happening is it just refreshes... I thought maybe I can do this to get the error and to display an error but all I get is the 'refresh': if($_FILES['img']['error'] == 1) // 1 means: The uploaded file exceeds the upload_max_filesize directive in php.ini.{ $this->error = 'Too big'; return; } http://www.php.net/manual/en/features.file-upload.errors.php Is it possible to have the file size checked before the whole thing is uploaded? I thought perhaps that's what I was able to do with the above as well. I noticed that the whole file is uploaded and THEN the check takes place. Thank you.
  24. Don E

    Webstudio

    Go to webstudio.com to see what it is. No, most designers/developers do not use this software. Some do though but it depends. If you want to code everything yourself, best to stay away from these kind of programs.
×
×
  • Create New...