Jump to content

gw1500se

Members
  • Posts

    1,033
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. First, don't embed your PHP code like that. Separate your HTML from the PHP code. Second, don't use * in your select. Extract only those variables you plan to actually use. To do what you want, you need to create a form that submits your data when you click one of the buttons. See this article about using forms and passing data to PHP.
  2. First please use the code icon (<>) and select PHP for your code. It makes it much easier to read. I'm not sure but I think you need to change your loop to this: $rows = $resultset->fetch_assoc(); foreach ($rows as $row) { $var_course_id = $row['course_id']; echo "<option value='$var_course_id'>$var_course_id</option>"; }
  3. It is not clear to me what you are really asking. If you just want to use an IP address in the URL, that is not unusual. $url = "http://127.0.0.1/index.php";
  4. It can be done and is a routine thing. Here is a simple example.
  5. Its possible that simple_html_dom is not installed on that server. Do you have error reporting turned on?
  6. <div class="section" style="<whatever css style you want>"> <?php if(isset($_SESSION['uid'])) { echo 'Hello,'; echo $_SESSION["uid"]; } ?> </div>
  7. I'm not sure if this possible but I have a bunch on links on my page that are jpg files. When I click on the link it opens the image in a new window which is exactly what I want. However, I need that jpg to automatically resize as if there were an img style attribute: img { max-width=100%; height=auto; } Is there a way to do that without creating an HTML page for each JPG with an img tag in it? TIA.
  8. This is really a MySQL question. I'm not a MySQL expert so I don't know where latitude and longitude come from. I assume they are columns in your data base. I've never used a calculated value for ORDER BY rather than a column value. In my scenario I don't store that in my database. I just pass the zip codes to the MapQuest API and get the distance when I need it. If it were me I'd put the zip codes in an array, then add the distances to that array from the API and sort the array on the distances.
  9. Post your current code.
  10. I do something similar and use the MapQuest API. You have to sign up for a key but it is free.
  11. round(floatval($item['in_bytes'])/1000000,2); I used 'floatval' instead of 'intval' since that is what 'round' wants. The 2 gives 2 decimal places but you can use what you want.
  12. Simply divide it by 1000000 then round to get the desired precision. You may need to use intval to make the string an integer first.
  13. Here is a handy tool to validate your HTML.
  14. If I understand, you are really using the wrong approach. You really want to use preg_match and a regular expression. I am not a regexp expert so you should ask tor the expression in the regexp forum.
  15. $chunk is whatever you name the array you split into. RTFM.
  16. $array1=$chunk[0]; $array2=$chunk[1]; Assuming it was split into 2 chunks.
  17. Good catch. I missed that subtlety.
  18. You need to change your loop from a while to a for. for(i=0; i<$rowCountUpdate; i++) What seems strange to me is that you are not changing your query parameters on each pass. It looks like you are always updating the same row thus the infinite loop.
  19. Your syntax was just messed up. You can see how much simpler Barand's code is. There are a couple of ways to do the same thing but none are complicated. When you find yourself adding too many quotes and other symbols you are probably on the wrong track. PHP recognizes anything that starts with $ as a variable and does substitution. If you need to have a string that starts with $ and do not want substitution then you need to escape (\) the $, thus \$whatever.
  20. You are not passing $Connection to the function so it is undefined. If you had errors turned on you would have seen that.
  21. https://www.php.net/manual/en/class.domnodelist.php
  22. First, please use the code icon (<>) and select PHP for your code. The formatter makes it much easier to read. As for your question, PHP has a function to handle json called json_decode. It will create and associative array so you can access whatever you need easily.
  23. Excuse me but "all of the experts?" Bull$hit. Requinix IS an expert as well as Kicken. You would be foolish not to heed their advice and it sounds like you will be foolish.
×
×
  • 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.