Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Have you considered media queries to adapt the CSS as needed? https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
  2. Have you tried using mysql_error() to see if any errors are being returned? http://www.php.net/manual/en/function.mysql-error.php Assuming that the "posted" column is using the datetime field type, you'll need to modify $mydate so that it matches the expected format.
  3. If the date values aren't stored as a date type in the database, you could use PHP to figure out the month. For example: <?php echo date('n', strtotime('01/01/2013')); ?> More information about these functions, including examples, can be found in the PHP manual: http://www.php.net/ Once you know the month for each date, it just comes down to counting the occurrences.
  4. Congrats!!
  5. Try the following: <h2 class="description"><?php _e($this->video['description']); ?></h2> Note that I removed "echo" and added the underscore to match the example here: http://codex.wordpress.org/Function_Reference/_e
  6. The GET variable from the links is being assigned to $menu_id. But your query is using a variable called $page_id. Have you tried the following: $menu_id = $_GET['cat']; $query="SELECT page_id, title, sub_title, content from paginas where menu_id=$menu_id";
  7. Have you tried using an anchor tag? https://www.google.com/search?q=html+anchor+tag
  8. Have you tried clearing the float? <div style="width:80px;height:25px;float:left;clear:both;"> Note the "clear:both;" declaration at the end.
  9. What does your code look like? Note: please surround your code with tags. This will make your post and code easier to follow.
  10. As Psycho suggested, you'll want to validate the number that comes from the text file. You could use something like the following: <?php $validValues = array(1,2,3); if (file_exists('number.txt')) { $fil = fopen('number.txt', r); $dat = fread($fil, filesize('number.txt')); if(in_array($dat, $validValues)) { echo "<img src='image{$dat}.png' />"; } fclose($fil); } ?>
  11. Your submit button is named "save"...try the following: <?php if(isset($_POST['save'])){ $slno=$_POST['slno']; echo "hello"." ".$slno;// this is to print. } ?> Also, I would recommend checking out the following article with regard to using PHP_SELF: http://seancoates.com/blogs/xss-woes
  12. Also, you have some extra parenthesis after the echo statements. For what it's worth, you could simplify the code by using file_get_contents(). You also don't need the separate if tests for $dat. You could try something like this: <?php if (file_exists('number.txt')) { $fil = fopen('number.txt', r); $dat = fread($fil, filesize('number.txt')); echo '<img src="image' . $dat . '.png"'; fclose($fil); } ?> Of course, you should check that the image file exists before trying to display it.
  13. POST variables can also be tampered with.
  14. Are you trying to create a table? If so, perhaps the table tutorial from FPDF's website will help: http://www.fpdf.org/en/tutorial/tuto5.htm
  15. Are your products stored in some sort of database? If so, you could pass the information which is used to calculate the total (such as product IDs, quantities, etc.) via GET variable(s). That information will be easier to validate than a total.
  16. Have you looked into SESSION variables? http://www.php.net/manual/en/intro.session.php
  17. It sounds like you're trying to use the value which was entered in the "code" input. If that's the case, you could use $_POST['code']. if(isset($_POST['code']) && $_POST['code'] != 210392) { echo "https://www.google.co.uk"; } Note: since $_POST['code'] will be undefined until the form is submitted, I used isset() to prevent the page from showing an undefined variable message.
  18. It sounds like you're describing the alternate syntax for if statements: http://www.php.net/manual/en/control-structures.alternative-syntax.php You can also use curly brackets: http://www.php.net/manual/en/control-structures.elseif.php
  19. It means that your $authorise variable is undefined. Is that variable supposed to come from the form? If so, you'll want to look into using $_POST and isset().
  20. Perhaps the following will help: http://msdn.microsoft.com/en-us/library/ie/dn255008(v=vs.85).aspx
  21. The button can also be changed to (note the type attribute): <input type="submit" value="submit" id="btn"/>
  22. Note that "td" and "company_name" are two different class names. Also, are you familiar with the "Inspect element" feature for browsers like Chrome, Firefox, and IE? It can help you track down how styles are being applied to the image/div tag.
  23. For what it's worth, PHP has a built-in function for validating things like email addresses: http://www.php.net/manual/en/filter.examples.validation.php
  24. Perhaps you just need to validate the code? http://validator.w3.org/ One issue with the HTML code is that you closed the body tag before the form is displayed. The body tag should be right before the close html tag. </body> </html> Also, you should look into the following function: http://www.php.net/mysql_real_escape_string And in case you're not aware...the mysql_ function have been depreciated. At some point you'll need to look into an alternative database connection: http://www.php.net/manual/en/mysqlinfo.api.choosing.php
  25. Have you tried using a root-relative path? You could use $_SERVER['DOCUMENT_ROOT'] as shown here: http://www.php.net/manual/en/function.include.php#86842 Of course, you'll need to adapt the path so it points to phpguard_folder.
×
×
  • 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.