Jump to content
Larry Ullman's Book Forums

margaux

Members
  • Posts

    453
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by margaux

  1. You're right in that its your file structure. If your root directory is public_html and includes is one below the root, I would think that define ('BASE_URI', '/public_html/html/includes/'); should be define ('BASE_URI', '/public_html/'); and require ('./includes/config.inc.php'); should be require ('includes/config.inc.php'); You may need to change all your require and include statements.
  2. Can you be more specific - what debugging attempts have you tried and what was the outcome? Do you know that your script is connecting to your database? Maybe you should post your code as well.
  3. Checkbox is a boolean so in your register.php file it should be && $_POST['terms'] == true
  4. You need to change the configuration of your config file to turn error reporting on. Edit the php.ini file for your version of php to set the display_errors flag to on.
  5. margaux

    Disable Css Tip

    That's a good tip, its alot quicker than using /* */ - thanks for posting. How did you discover it?
  6. Yeah, I have come across this requirement a few times. One option is to display the file name next to the upload button with a message asking them to reselect it. Its not the most user friendly approach but I think its better than doing nothing. If you find another solution, please post it. The security precaution makes sense once you know it but if you don't inform your user, they might think there is a problem.
  7. Thanks Paul_Blackpool and HartleySan for taking my comments in the spirit they were intended. I like to help on this forum because I learn so much from it that I want to give something back and because it is a great way to consolidate my own learning and understanding of various concepts. Other people will help you more if you make your posts readable: 1. Before you click 'Post', click on 'More Reply Options' to show you a preview of your post. 2. When you want to paste some code into a post, first click on the icon <>, this will bring up a modal box and you can paste your code in the box. It will then be formatted nicely like in HartleySan's post. 3. use the formatting options to change the size of your text so it is more readable. 4.Try hovering your cursor over the various icons above the edit post panel and you'll see that there are a lot of formatting options to help you. 5. If you're not sure how to edit the post, just ask. When I first started visiting forums, I didn't know how to use code tags but try different options and you'll find out.
  8. Hi Larry, I hadn't seen your 'New Design' post so when I accessed your site earlier today at a cafe I was surprised to see a new design. I like the new design alot on a laptop but I hope you don't mind my saying that it doesn't work well on a mobile phone which I often use to access your forum. Here are my comments: 1. The mobile screen is completely filled with your logo and a lot of white space, it almost looks like a holding page. 2. You have to scroll a long way to get to the nav bar and there is no link to the forum. Actually I just found the link to the forum but the little icon which expands the menu is too close to the rss icon and therefore not recognisable as being a link. I know its the same icon that facebook uses but I'm not sure everyone will recognise it for what it is. I would suggest making it bigger and giving it some breathing room. 3. I would be inclined to show a summary of the latest blog post as you do in the laptop version rather than the whole article, but I appreciate that would be contradictory to your objectives. I'm in the process of redesigning my own website from an rwd perspective so I would be interested to hear any particular challenges you faced.
  9. How many times have people on this forum asked Paul_Blackpool to amend how he posts threads? We're not asking because we're being difficult, we're asking because its about keeping the forum working in the way it was originally intended. As long as people keep responding to his posts despite the ridiculous amount of tiny coding, he is not going to change how he posts - why should he. @Paul_Blackpool, if you don't know how to preview/format your posts just ask - you'll engender a lot more good will. Sorry if this sounds harsh but this is a good forum and I'd hate to see it go the way of many others through carelessness.
  10. Thanks Rob and Larry for your replies. I've posted this query on other forums and googled numerous variations on this theme. Generally the responses have been what I originally suspected - that there is no easy way to do this. The client is not concerned if the email is read, only that it is delivered as in Larry's definition above (which btw it is helpful to distinguish between delivered and received). As the client is sending a high volume of emails, it is not efficient to request read receipts or use the image hack which rob refers to. One option which I found on another forum is... Whilst not appropriate for my particular circumstance, this might be useful in a different situation. Anyway, learned a little in the search and this may be of use for someone else.
  11. What about using str_replace on $line before you explode it? e.g. if ($kountLines >1) {// don't include the column names which are in the 1st line $newline = str_replace('""','',$line); $arrResult[] = explode( ',', $newline);
  12. HTML5, Digital Classroom is good for HTML and CSS and provides a good intro to HTML5 and CSS3. For CSS, in addition to Dan Cedarholm's books I would also recommend CSS Mastery and anything by Eric Meyer. @Rob - please would you expound on why you like the Sitepoint book for HTML5. I've used HTML5, Digital Classroom which is pretty good but I'm looking for something more detailed.
  13. Is it possible to programmatically check if an email has been delivered?
  14. seriously??? There are so many things wrong with this post that you are not going to get any help unless you amend it. Way too much code. Insert your code within code tags - or use the <> icon on the edit tool bar Only include the code that is relevant - no one is going to wade through all that code This is not really a forum for help on html and css - we will be happy to comment on html and css code but post in the correct forum. At least take out the css and put into an external file to link to Have you run your code through the W3C validator?
  15. I'm not sure uploading multiple files is covered in the book but you can do this by adding additional input fields to your form e.g. <input name="myfiles[]" type="file" /> <input name="myfiles[]" type="file" /> You will be able to get information about the files via the $_FILES global array including the original filename. Check out the php manual re $_FILES and multiple file uploads.
  16. Which templates have you used and would recommend, and how easy are they to use? Ive read very mixed reviews about Smarty.
  17. As an aside It would help if you proofread your post before posting as you appear to have duplicate tags and queries. Also it would help if you inserted your code between code tags (there is an icon you can use on the edit bar). Here's why you're getting the undefined index error: The first time your script is run, the form has not been submitted so the $_POST array will not have any values. You need to start with a conditional to check for this index if (isset($_POST['term'])) { You're using the improved version of mysql (mysqli) to connect to the database and the old version mysql to make your query. Here is a simplified version of what I think you're trying to do using mysqli. You may need to change the $dbc variable to match what is in your mysqli_connect.php file <form action="searchlast.php" method="post"> Search: <input type="text" name="term" /><br /> <input type="submit" name="submit" value="Submit" /> </form> <?php if (isset($_POST['term'])) { echo $_POST['term']; require_once ('mysqli_connect.php'); $term = $_POST['term']; $query = "select * from designers where first_name like '%$term%'"; $result = mysqli_query($dbc, $query); while ($row = mysqli_fetch_array($result)){ echo 'designer_id: '.$row['designer_id']; echo '<br/> First Name: '.$row['first_name']; echo '<br/> Last Name: '.$row['last_name']; echo '<br/><br/>'; } } ?>
  18. What errors are you receiving? Your query is incorrect. You need to have a tablename following the first FROM. The second FROM clause is redundant and will also throw up an error. Which fields do you want to retrieve? You've specified 2 sets of fields - all by using *, and first_name, last_name. Run your query directly using phpmyadmin or some other mysql client and you will get some helpful error messages. where is $product_search coming from - your code does not show where you are setting it to something that you can search against so I'm guessing you are getting some kind of undefined variable error message.
  19. <li id="quantity">Qty</li> document.getElementById("quantity") gets ANY HTML element that has an id equal to "quantity, not just a form element. e.g. it would get the above list element. using the above html code example var quantity = document.getElementById("quantity") var quantity would be set to "li" and var quantity = document.getElementById("quantity").value var quantity would be set to "Qty"
  20. The @ before all of your mysqli statements has the affect of suppressing the errors so you'll want to start by removing the @. also have you tried the steps outlined in the debugging chapter. I repeat this because I learned so much by doing this and found that I made far less errors and when I did make an error I was able to find the cause easily.
  21. The register script uses the following line of code to check that all validation checks have passed before continuing with the registration process. if ($fn && $ln && $e && $p) You could create another variable when you validate the checkbox and include it in this line e.g. if (isset($_POST['terms'])) { $terms=TRUE } else { echo '<p class="error">You must accept the terms and conditions of use.</p>'; } Then add $terms to the check that all validation has passed. if ($fn && $ln && $e && $p && $terms) and at the start of the script set $terms to false $fn = $ln = $e = $p = $terms = FALSE;
  22. $r = @msqli_query ($dbc, $q); // Run the query The line above should be $r = @mysqli_query ($dbc, $q); // Run the query While you're testing your code you probably do not want to suppress errors - you would have picked this up immediately. I recommend following the tips in the chapter on debugging, it will save you hours of time and you'll find that you learn alot from finding your own errors.
  23. // Check for last name: if (empty($_POST['last_name'])) { $errors[] = 'You forgot to enter your last name.'; } else { $fn = trim($_POST['last_name']); } // Check for an email address: if (empty($_POST['email'])) { $errors[] = 'You forgot to enter your email address.'; } else { $fn = trim($_POST['email']); } the above 2 lines are causing your errors, as you keep setting the variable $fn, change them to // Check for last name: if (empty($_POST['last_name'])) { $errors[] = 'You forgot to enter your last name.'; } else { $ln = trim($_POST['last_name']); } // Check for an email address: if (empty($_POST['email'])) { $errors[] = 'You forgot to enter your email address.'; } else { $e = trim($_POST['email']); }
  24. To make a checkbox 'sticky' you can use something like <input type="checkbox" name="terms" value="Yes" <?php if (isset($_POST['terms']) && $_POST['terms'] == "Yes") {echo " checked";}?>/> As for your first question - we really need to see more of your code to see why the logic isn't working. Are you setting some kind of error flag or adding errors to an error array which is checked before the registration process is carried out?
×
×
  • Create New...