-
Posts
1,033 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
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.
-
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>"; }
-
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";
-
It can be done and is a routine thing. Here is a simple example.
-
<div class="section" style="<whatever css style you want>"> <?php if(isset($_SESSION['uid'])) { echo 'Hello,'; echo $_SESSION["uid"]; } ?> </div>
-
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.
-
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.
-
Post your current code.
-
I do something similar and use the MapQuest API. You have to sign up for a key but it is free.
-
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.
-
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.
-
Here is a handy tool to validate your HTML.
-
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.
-
How do I split a 'range' string into two lots?
gw1500se replied to simona6's topic in PHP Coding Help
$chunk is whatever you name the array you split into. RTFM. -
How do I split a 'range' string into two lots?
gw1500se replied to simona6's topic in PHP Coding Help
$array1=$chunk[0]; $array2=$chunk[1]; Assuming it was split into 2 chunks. -
How do I split a 'range' string into two lots?
gw1500se replied to simona6's topic in PHP Coding Help
array_chunk -
Good catch. I missed that subtlety.
-
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.
-
Href - use id of href & concatenation inside loop.
gw1500se replied to JonnyDriller's topic in PHP Coding Help
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. -
You are not passing $Connection to the function so it is undefined. If you had errors turned on you would have seen that.
-
Get data from evert <tr> from external URL with file_get_contents()
gw1500se replied to aThomsson's topic in PHP Coding Help
https://www.php.net/manual/en/class.domnodelist.php -
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.
-
Best way to set up a "Checkout Transaction"?
gw1500se replied to SaranacLake's topic in PHP Coding Help
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.