Jump to content

gw1500se

Members
  • Posts

    1,040
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. 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?
  2. Where do you issue the session_start()?
  3. Typo. Should be $max.
  4. Then you need to set up a ratio to normalize the percentage. $percent = ((%max - $price)/$max)*100
  5. 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.
  6. I think I understand the problem. You want the records where either condition is true, right? I think you need 2 where clauses separated by an or.
  7. Try removing the {}. Not sure why you think you need that.
  8. $v is the value coinciding with the key, $k. echo "<td>" . $v . "</td>";
  9. First please us the code icon (<>) on the top menu. A quick glance I see something I don't think you meant: if($st1 == $st2 or $st3){ This will always evaluate to true since $st3 will be true. I am guessing you really meant this: if($st1 == $st2 or $st1 == $st3){
  10. 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?
  11. 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.
  12. There is a PHP library for that called TCPPDF.
  13. 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
  14. What type interface device are you using?
  15. 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.
  16. 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?
  17. Sounds to me like you need to backup and rewrite the original data schema. From where is the data coming?
  18. Without criteria there can be no test.
  19. 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?
  20. You want to process the output? Why not do that in PHP as well?
  21. From command line: <path to php.exe> -f "<path to script.php>" -- -arg1 -arg2 -arg3
  22. 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.
  23. 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 ']'.
  24. 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.
  25. $result=$stmt->fetchAll(); echo "<pre>"; print_r($result); echo "</pre>";
×
×
  • 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.