Jump to content

dptr1988

Members
  • Posts

    372
  • Joined

  • Last visited

    Never

Everything posted by dptr1988

  1. Note: If your email address, 'glenwic********@gmail.com' is valid, you might want to remove it from these posts, to avoid spam.
  2. Set a session varible in the 'sign_in.php' page and check for it in the '_login.php' page. http://us2.php.net/manual/en/function.session-start.php http://us2.php.net/manual/en/reserved.variables.session.php
  3. On line 39, you forgot a semicolon at the end of the call to the mail() function. Also, do you ever indent your code, or was that just a posting mistake: Corrected code: <?php // Create shorthand for the form data $firstname = $_REQUEST['firstname']; $lastname = $_REQUEST['lastname']; $email = $_REQUEST['email']; $comments = $_REQUEST['text']; // Check form Submission if (isset($_POST["submitted"])) { // Minimal Form Submission if (!empty($_POST['firstname']) && !empty($_POST['lastname']) && !empty($_POST['email']) && !empty($_POST['text']) ) { // Create the Body (format of Email) $body = "First Name: {$_POST['firstname']}\n\nLast Name: {$_POST['lastname']}\n\nEmail: {$_POST['email']}\n\nComments: {$_POST['text']}"; // Make it no longer than 70 characters long (WordWrap) $body = wordwrap($body, 70); // Send the Email mail('************@gmail.com', 'Contact Form Submission', $body, "From: {$_POST['email']}"); // Print a Message echo '<p><em>Thank you for contacting us, <b>$firstname</b>! We will respond to you within 12 hours at <b>$email</b></em></p>'; // Clear $_POST so that the form's not sticky $_POST = array(); } else { echo '<p style="font-weight: bold; color: #C00">Oops! You forgot to fill out some information! We would like to remind you that no information will be shared with anyone!</p>'; } } ?>
  4. Well, takes time to learn CSS. That is why I'm asking the people that already know it, if there is any type of 'structure' to it. If there isn't any 'structure' to it, I don't want to take the time to learn CSS layout. I'll just wait a couple years until someone invents something else. HTML is going to be redesigned/replaced/redefined sometime soon. It sure needs it! But do you people that already know CSS think that there is some 'structure' to it? Or is it more of a set of 'hacks' that you have gathered and put together?
  5. You SQL query is incorrect. You need to UPDATE rather then insert Also try escaping the quote before putting it in the query. eg: <?php $escaped_quote = mysql_real_escape_string($quote); $sql = mysql_query("UPDATE `users` SET quote ='{$escaped_quote}' WHERE `username` = '{$session}'"); echo "Thank you for updating your profile!"; if(!$sql) { die mysql_error(); }?> Also are you getting any error messages?
  6. you need to put a dollar sign '$' in front of each variable line 6 should start with $sql rather then sql
  7. First result in google: http://en.wikipedia.org/wiki/AJAX retro: Nice, i've always wanted to do that too!
  8. You need to upload the file from your computer to the server for the server to be able to mail it. http://us3.php.net/features.file-upload
  9. You need to check if the form has been submitted with isset() <?php if (isset($_GET['product']) AND isset($_GET['price']) AND isset($_GET['description'])) { // Add the product add(); } ?>
  10. The HTML output is all messed up!!! The document does not containt the basic html, head, body structure. The w3c validator can point out all of the HTML errors for you. http://validator.w3.org/. Once you get the HTML errors fixed, then this submit button problem will probably fix it's self. http://validator.w3.org/check?uri=http%3A%2F%2Fdeanwhitehouse.awardspace.co.uk%2Fhome.php&charset=%28detect+automatically%29&doctype=Inline&group=0
  11. External CD drives was my second guess. Most of the external CD drives i've seen have been on the ultra slim laptops. I'm really sure that it's a docking station port. I just looked at 3 dell laptops around here and the have a simlar port in the back for the docking station. They have two rows of 'pins' like in your picture. The 2 HP laptops i have here with an expansion port, have 1 row of pins on the side for the expansion port Is it on the back or the side? Docking station ports would be on the back to allow access to the screen and keyboard in the front.
  12. OK, got to get some basic statements out first. 1. I think CSS layout is better then a table based layout ( especially when your start using spacer gifs etc..) 2. I don't know very much about CSS. I've mostly used it to set the style of my paragraphs and code blocks, etc 3. I'm not an expert with HTML either But most of the CSS layout examples that I've seen, seem to contain a lot more 'hacks' then an organized, structured layout. That is what has stopped me from being able to learn CSS layout. I don't see any type of structure to it like you would see in a table layout. In table layouts, you can visualize it as a 'grid' where with different sizes of cells, rows and columns, but in CSS, the best organization is see is nested divs. Was CSS meant to be used to control the website layout or just basic stuff like size, colors, borders, etc? Am I all wrong? Is there some beginners tutorial that can explain the basic structure of a CSS layout? To me, using CSS for layout seems to be the HTML equivalent of spaghetti code.
  13. Yes, you images probably are taking up more bandwidth then the rest of the files, but what is the total bandwidth compared to your maximum bandwidth capabilites? Have you confirmend that it's a bandwidth issue or a CPU issue? If it is hotlinking, those must be VERY popular images to be able to have three images slowing down your server. Doesn't your hosting company provide some type of 'cpanel' type interface that allows you to see server stats like processer load, percent bandwith usage?
  14. Is that a laptop? It kind of looks like laptop docking station port. Or a specialized laptop accessory ( external CD drive, etc ) port.
  15. He is not editing your source code, he is editing a COPY of your source code that he downloaded from your website and saved on his computer. Once he edits it, he can view the edited file from his computer with his web browser. When he views the source of your website and edits it, he is just editing a local copy of the HTML code and ( unless he has a really weird browser add on ) will see the original HTML code from your website next time he visits. In other words, the edited code is totally unrelated to your website as far as the browser is concerned.
  16. PHP automatically closes your MySQL connections for you unless you have specifically requested persistent connections, so it's not that. Have you checked if it's 'slow' bandwidth, or 'slow' server performance ( ie, SQL query or page generation performance )?
  17. should be echo("cookie is now set to: {$_COOKIE['GSAdminUser']}"); If you want to access arrays inside of a string you need to use the 'curly bracket' sytax. http://www.phpcodinghelp.com/article.php?article=strings#syntax_variable
  18. Here is an example: <?php $input = "-----MMMMM------IIIII----MMM---OOOO---I---MMMM-----"; $trash_char = '-'; $results = array(); $current_char = false; $a_index = 0; for( $i =0; $i < strlen($input); $i++) { if ($input[$i] != $trash_char AND $current_char === false) { // We are in a new group $current_char = $input[$i]; $results[$a_index]['start'] = $i; } elseif ( $current_char !== false AND ( ($input[$i] != $current_char) OR ($i+1 >= strlen($input) ) ) ) { // We are at the end of the group $results[$a_index]['end'] = $i - 1; $results[$a_index]['char'] = $current_char; $current_char = false; $a_index++; } // else skip over that char } print_r($results); ?>
  19. Yes, but I don't know of any PHP function that would do it, so you would need to make your own. Here's how I'd do it. Skip over the string untill you find anything but the '-' char. Save that char that you just found in a variable, and then keep on searching untill you find something other then that char from the variable. Store the new char in the variable and repeat untill the end of the string.
  20. In this example $myFile doesn't appear to be valid filename. Are you getting any error message when you try to open the file Have you used var_dump($line) after using fgets() to make sure that you actually got some thing. You are not checking the return codes on your functions. You should check the results and see if you are getting any errors Here is more on checking your function error codes: http://www.phpcodinghelp.com/article.php?article=debug#basic_function_results
  21. Here is a tutorial on user logins: http://www.phpcodinghelp.com/article.php?article=user-login It will describe how to use permissions too.
  22. Yes, the default value can NOT be a variable http://us3.php.net/manual/en/functions.arguments.php The example you showed with the NULL default value is the way I do it. It's not that bad.
  23. All data in the $_SESSION variable stays on your server and is very secure. The only way to mess with sessions is to try to get a different session ID, which is pretty hard to do. Even if a use does get a different session ID, he will still not be able to modify the session variables, he is just using somebody else's session id which would mean he appeared to be logged in as a different user. Wikipedia: http://en.wikipedia.org/wiki/Session_fixation
  24. Where is line 20 in this example you posted?
  25. Do you have your error_reporting set to E_ALL? Try var_dump() on your $diff variable. array_diff() isn't supposed to fail, so I'm really sure it's your input variables that are faulty. try checking them with print_r() too. Which version of PHP are you using?
×
×
  • 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.