Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. Topic locked. You already have a topic open with the same problem here. http://forums.phpfreaks.com/topic/288870-get-rid-of-superfish-div-after-php-execution/?do=findComment&comment=1481321
  2. The same one as you're currently using
  3. Whats with the mysqli_result function? Just use a while loop like so <table> <?php $result = mysqli_query($con, 'SELECT id, name FROM roster'); while(list($id, $name) = mysqli_fetch_row($result)) { ?> <tr> <td><?php echo $id; ?></td> <td><?php echo $name; ?></td> </tr> <?php } ?> </table> Also don't use <font></font> in your HTML. Instead learn to use CSS to stylise your text <style> body { font-family: Arial, Helvetica, sans-serif; } /* Default text styling for all elements on the page */ </style>
  4. I have remove your code from your post. It would be helpful if you only posted the relevant code to your problem. No one is going to shift through lines and lines of code and find/fix the problem for you. if you want that then we have a freelance forum where you can hire someone to do that for you.
  5. Could use regex $description = preg_replace('#<p><a[^>]+>[\w\s]+</a> posted a (photo|video):</p>#i', '', $item->description);
  6. Yes you can use phpMyAdmin to examine the data in your database. Head over to http://localhost/phpmyadmin (or left click the WAMP and icon and choose phpmyadmin)
  7. Not sure but it sounds to me you need to setup wildcard subdomains so all subdomains point to thisdomain.com.
  8. Wrong character. You need to read .josh post again. This is the output of your code with the regex ended with a $ O'BrianĀ£$%^&*() This does not match Because it is a sub forum to the PHP Help forum.
  9. Copyt the code used for the forms onSubmit event and apply it to an onClick event for the delete link, example $searchResults .= " <td><a href='Admin_Delete_Student.php?id={$student_id}' onclick=\"if (! confirm('Delete this user?')) return false;\">Delete</a></td>\n"; Beware though. If the user has javascript disabled they will not be prompted with the confirmation dialog box.
  10. The problem is to do with the closing heredoc delimiter ( ____________EOD; ) used on lines 34, 47 and 57. No characters (including spaces) should proceed the closing delimiter. The closing delimiter for a heredoc statement should start at the very first character of the next line. But there is no need for the use of heredoc in your situation, it is mainly used for large complex strings not for one liners. Lines 32 - 34 should be $photodisp[] = "$title"; Lines 45 - 47 should be $thumbs = "head"; Lines 55 - 57 should be $thumbs .= "View All Photos on Flickr";
  11. Nope you can be offline. http://localhost has nothing to do with the internet. When you go to http://localhost it will send a http request to port 80 on our computer. This is the port the Apache http server listens on for serving files. Sounds like WAMP is not running. If you have installed WAMP it should already by running. If not then I think you can goto Start > WAMP > Wampserver to get it running. The taskbar icon should then appear. If you're having problems starting WAMP then I recommend to get help from their official forum. That is not how you run php files. As I said you need to go to http://localhost in order run PHP code. You only open PHP files in the WWW folder if you are going to edit the code in your code editor.
  12. All you need to do is copy the two <input ..> lines to where you want them located in your form. Also why the disabled submit button? This will prevent the user from submitting the form.
  13. I would of thought WAMP shipped with that. If you want to know what it is the VC11 runtime environment. That will be firewall dialog box. Click allow (should only need it do it once). You need to accept it otherwise Apache will not work. Go to http://localhost and you should get the WAMP project index page. That will verify the installation was a success. Also there should be a WAMP icon in taskbar next to the clock, it should be green if all wamp components are running.
  14. That can be handled by your query, example SELECT id, lineno FROM table WHERE hitcount = 0 The above query will return all records with a hitcount of 0 If you want all records where lineno is not 3 and has a hit count of 0 you'd use SELECT id, lineno FROM table WHERE lineno != 3 && hitcount = 0
  15. They are both the same really. The difference is with the bundled software/user interface which adds no real benefit for developement. They just provide an easy to install all-in-one package for setting up the AMP stack required for developing/testing PHP code locally on your PC. Just chose the one you find easiest to use. Personally I prefer to install the AMP stack manually rather than use an all-in-one package. Everything you need should come with the wamp installation package. Not sure what you mean by that... Updates reported by Windows Update has nothing to do with WAMP.
  16. Correction to ginerjm post Read the manual on how to use function arguments
  17. As a tip you may want to also look at the inbuilt filter library for sanitizing/validating user input
  18. On second thoughts we'll leave it there. I aint digging through Dreamweaver spaghetti code.
  19. You have left yourself wide open for SQL injection attacks. You should never trust any user input. Before using any input in your query you should at least validate and sanitize it require_once ('../mysqli_connect.php'); // make sure movie_id request param exist and that is a number if(isset($_GET['movie_id']) && ctype_digit($_GET['movie_id'])) // validate { // cast the value of move_id to a integer $movie_id = intval($_GET['movie_id']); // sanitize $q = mysqli_query($dbc,"SELECT * FROM movies WHERE movie_id = $movie_id"); $r = mysqli_fetch_array($q); } Or a better alternative would be to use prepared statements
  20. Thats the problem the DisplayInfo method is returning a string value consisting of 5 white-space characters. This is causing empty() to return false, and so the Size is always being displayed. Why is that method returning that kind of value? Could we see the code for that method? For now a work around would be <?php if (trim($Size) != '') echo "<p><strong>Size</strong> $Size </p>"; ?> But ideally you want to change that method so it returns a boolean false or a null value if there is no value to be returned for Size
  21. You are getting those errors because those variables are not defined. You need to define those variables before using them as part of your query.
  22. What is the output of <?php $Size = $siteCart->DisplayInfo("Size") var_dump($Size); ?>
  23. Remove the || $Size != '0' from the condition. Also note $Color and $Size are not session variables. They are just variables defined in the applications scope, once PHP has finished parsing the script they will not be remembered. If you want a variable to maintain its values across multiple pages you'll need to use sessions
  24. A condition does not alter a variables value. How do you know that $Color is being changed to a zero? Your condition can be changed to <?php if (!empty($Color) || $Color != '0') echo "<p><strong>Color</strong> $Color </p>"; ?> Which will eliminate the need to have the else
  25. Change line 137 to if(isset($errors) && in_array($field, $errors)) {
×
×
  • 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.