-
Posts
1,040 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
First please use the code icon (<>) at the top of the menu for your code and specify PHP. Second, your question is too broad. What specifically don't you understand?
-
Where do you issue the session_start()?
-
Typo. Should be $max.
-
Then you need to set up a ratio to normalize the percentage. $percent = ((%max - $price)/$max)*100
-
You can't really do it with just PHP, which is server side only and stateless. It would take the user to do something each time you wanted to update the bar. The only way I can think of is to use Javascript to update the progress bar which is client side. If the server is needed to provide some kind of data to update the bar then you will need to use Ajax. Perhaps you need to explain what event(s) cause the progress bar to be updated.
-
$v is the value coinciding with the key, $k. echo "<td>" . $v . "</td>";
-
curl issue " SSL certificate problem: certificate has expired"
gw1500se replied to priyank199's topic in PHP Coding Help
This is really an SSL problem not PHP. However, why do you say no certificate has expired? Did you look at the certificate in question? Is it a self signed certificate or a certificate issued by the target web site? -
Not sure how you are reading the data since you didn't post the script but I suspect it is coming back in byte format. If that is the case you need to convert it.
-
There is a PHP library for that called TCPPDF.
-
This is probably really a raspbian issue so you may want to try the raspberry forum. However, what do you get when you run this script? for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do ( syspath="${sysdevpath%/dev}" devname="$(udevadm info -q name -p $syspath)" [[ "$devname" == "bus/"* ]] && exit eval "$(udevadm info -q property --export -p $syspath)" [[ -z "$ID_SERIAL" ]] && exit echo "/dev/$devname - $ID_SERIAL" ) done
-
What type interface device are you using?
-
I've worked with Raspian quite a bit and using serial devices on it can be tricky. Kicken is exactly right. Also depending on the serial device you are using you may need to install specific drivers. This is especially true if you are using a one-wire device over USB.
-
First your crontab is the long way around the barn. Use: */5 * * * * /usr/bin/php /var/www/settime.php Not sure why /bin/sh is involved base on what you've shown. What distro are you running? Since your didn't show the script how do you expect any help?
-
Sounds to me like you need to backup and rewrite the original data schema. From where is the data coming?
-
Without criteria there can be no test.
-
Only you can tell what output is valid. You need to tell us what criteria you want to use. What happened to the json part you wanted?
-
You want to process the output? Why not do that in PHP as well?
-
From command line: <path to php.exe> -f "<path to script.php>" -- -arg1 -arg2 -arg3
-
None of that data exists, at least in the posted HTML. Have you tried anything yet? I suggest you use DOMDocument and get the data into an array. Converting that to json for output is simple.
-
Connection between HTML table and MySql database
gw1500se replied to Setzi138's topic in PHP Coding Help
Remember Barand's first post. You need to check that the form was submitted before using the variables. P.S. That first '=' is a typo. Barand meant to close the brackets using ']'. -
Connection between HTML table and MySql database
gw1500se replied to Setzi138's topic in PHP Coding Help
You are probably trying to use those variables on the first output of the page. They will not be filled in until the user does it and the page is submitted. Your HTML shows not form or submit action. See this article on how to create an interactive page. -
$result=$stmt->fetchAll(); echo "<pre>"; print_r($result); echo "</pre>";