Jump to content

vigiw

Members
  • Posts

    100
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vigiw's Achievements

Member

Member (2/5)

0

Reputation

  1. It does appear neater , but thanks for the suggestions.. good for future ref.
  2. Hello.. I'm working on a switch statement with multiple possible conditions... Scenario 1: "(($var1 < 0) AND ($var2 < 0))" ... [Then something echoing both to 0] Scenario 2: "(($var1 < 0)" ... [Then something echoing var 1 to 0, and var 2's value] Scenario 3: "(($var2 < 0)" ... [Then Something echoing var 2 to 0, and var 1's value] Scenario 4 (Default): [Default/Normal Condition] - Simply echoes the values of both vars. When I try to get this going in a code, it simply doesn't work. Any ideas on how I can go about doing this, if possible in switch statements? I thought about if/else, but I have 4 different conditions to go through (if not Scenario 1, then 2... 3... 4... and I figured that was a bit much). Thanks.
  3. Ok thank you! I think it's all set now. In my if/else, when its <= 0, I made it = 0, it was going into the negatives, when I thought it was a hyphen. Thanks!
  4. It's probably because I changed one part, my fault for not mentioning it, I forgot. My points are based on 20, so I have another variable for $soc and $ec to multiply by 5 to get the percentage to plot on the map. That variable is just $soc_per and $ec_per printf('<img src="diamond_s%de%d.jpg" />', round($soc_per, -1), round($ec_per, -1)); But I think that's where it went wrong with the hyphens added in.
  5. Thanks! I think its getting closer... but when the result is, for example for image diamond_s20e90.jpg - it will go to diamond_s-20e90.jpg But all of the files are saved as diamond_s#e#.jpg like above--but no hyphens like in the second image name. Again, thank you for helping!
  6. Any ideas on how to make that work? ??? Thanks!
  7. Thanks, but how would I tackle the rounding problem. Like if the user gets 86 for one of them or 43 for the other, i only have files for the Tens (e.g. 90 and 40)
  8. Thanks for the help, but I couldn't go about doing the GD thing. So I made my own image files. It took a while (121 of them), but they are done. Is there a way, though, to take one of my numerical variables in the PHP script and say, for example (since there are two variables on this graph) if $soc = 40 and $ec = 60 - show image diamond_s40e60.jpg I realize that wasn't in a PHP script format, but that's because I'm not sure how I would include that with both. Also, my numerical values will not be exactly, let's use the example--40 soc---it might be: soc = 37, ec = 55. Any ideas how to script that? Thanks!
  9. Ok thanks. Would it be possible to do this if I simply echoed the image in, or do I need to do something special. Right now I have, just to call the image up for blank display: echo "<img src=\"diamond.bmp\">\n";
  10. Okay this is just a simple dot that I think would work. [attachment deleted by admin]
  11. Ok, thanks for the response. I attached an example of my "diamond". As you see there are two scales there on the bottom of the sides. I have two variables to match the scales in my script. Would I be able to take my first variable, $soc for the Social scale and $ec for the Economic scale and make one point where they meet on the image here? [attachment deleted by admin]
  12. Hmm... well, in that case, I must ask if I need to install GD or if its already part of PHP 5. And you now probably know of my serious lack of experience in GD.
  13. Ok, I have a form which sends to a PHP script--that's all set and working (thanks to the help of forum members here! ). Now, I'm wondering on my PHP page, if I would be able to plot, kind of like a graph, onto an image. Here's what I'm thinking. I already have the code all setup with the image "echoed in" successfully, and I have two numerical values based on calculation on the form (which is done). My image looks like a graph, with an ongoing scale, in the shape of a diamond. (One scale running along the bottom to the left, and one from the bottom--to the right). Is there a way, based on the numerical result, for example, my two variables are $soc and $ec - could the script place them on the graph/image according to the scale? This might have been a bit confusing, so if you think this is possible, or if you need more input, just ask me. So any help would certainly be extremely appreciated. Thanks in advance!
×
×
  • 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.