# possien

Members

80

• #### Days Won

2

possien had the most liked content!

## Community Reputation

4 Neutral

• Rank
Regular Member

• Website URL

## Profile Information

• Gender
Male
• Location
Arizona
• Interests
PHP Javascirpt CSS Flying Drones, RC Planes, Motorcycle racing
1. ## GD or SVG graphing math

Ok, I finally got it now, understanding transform: function compass(){ \$angle = array(0,45,90,135,180,225,270,315); for (\$i = 0; \$i <= 7; \$i++) { \$a = \$angle[\$i]; \$Ox1 = 50; \$Oy1 = 50; \$rad = 40; \$x = 50 + round(\$rad*cos(deg2rad(\$a))); \$y = 50 - round(\$rad*sin(deg2rad(\$a))); //echo 'x= '.\$x.' | y= '.\$y.'<= for angle '.\$a.'<br>'; \$html = '<line x1="'.\$Ox1.'" y1="'.\$Oy1.'" x2="'.\$x.'" y2="'.\$y.'" style="stroke:red;stroke-width:2"/>'; \$html = \$html++; echo \$html; } } ?> <svg id="svgelem" height="100" xmlns="http://www.w3.org/2000/svg"> <svg width="100" height="100"> <g transform="translate(0,100) scale(1,-1)"> <circle cx="50" cy="50" r="48" stroke="green" stroke-width="2" fill="#EFA" /> <?php compass();?> </svg> Thanks gizmola and Barand! Now to spherical trig...
2. ## GD or SVG graphing math

I think I am getting there, I changed the origin to x=0 and y=max of the plot area and for negative values origins are x=max and y = max of the plot area (separate SVG graphic). Thanks for the math help and links. I do believe SVG is much easier.
3. ## GD or SVG graphing math

I have tasking to produce graphs that convert polar coordinates to x,y and spherical trig plots. Since GD and SVG origins are inverted or backwards from a normal xy graph, is there a way to convert xy to GD or SVG using math? The calculations to plot in normal xy are relatively easy and some have negative values but I am not having success at putting the output to a usable display. Any suggestions? <!DOCTYPE html> <head> <title>SVG</title> <meta charset="utf-8" /> </head> <body> <h2>HTML5 SVG Plot Polar to XY Line</h2> <?php \$rad = 25; \$x = round(\$rad*cos(45)); \$y = round(\$rad*sin(45)); echo "Value of x: ".\$x."<br>"; echo "Value of y: ".\$y."<br>"; echo "Plot of a 45 deg's with PHP in red, correct plot in blue"; ?> <svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg"> <svg width="100" height="100"> <circle cx="50" cy="50" r="48" stroke="green" stroke-width="2" fill="#EFA" /> <line x1="50" y1="50" x2="<?php \$x;?>" y2="<?php \$y;?>" style="stroke:red;stroke-width:2"/> <line x1="50" y1="50" x2="100" y2="0" style="stroke:blue;stroke-width:2"/> </svg> </body> </html>
4. ## Make a class or not

I agree with everything after "proposing procedural masked by OOP", as mentioned there is a great deal to OOP and you have to start somewhere. I am sure in his CMS there would be several integrated classes and your description of the image class is spot on. You are correct in saying there is a great deal to OOP but the main point I was trying to make was group self-sustainable objects and as you indicated, in a reusable fashion.

6. ## Attaching image to email from form

I would approach it a little differently. Rather than just email the webmaster with the info and pic, I would want something more permanent and extensible. For example something like: The customer fills out the form and submits a picture file (modify the form The customer receives an acknowledgement email The image is uploaded to a file location (/customer_image/some_pic.jpg) Database is used to capture the form information plus the filename of the image. Webmaster gets notified (and others) of inquiry. Webmaster goes to the query page and can review all customer queries and images (have to build page for this) Webmaster can click on customer link and respond to query (email response form). This response is also put in the database so if someone else needs the info or review. Additional responses to the customer could be sent from the response page and entered into the db. This would allow a permanent record of customer queries and responses. It takes a bit of work to send attachments in emails and would require a function being built to handle the mime types for attachments or you can find a package that provides this. With the amount of work, I would rather go with what I have described above. Either way you should update your functions file to use mysqli instead of mysql or use PDO, mysql is obsolete.
7. ## Attaching image to email from form

Can you post functions.php file? Are you using a database?

9. ## clearing information

So if the input box changes you want it to clear the value of 'title' and start new. You would have to compare the value of the text box to the previous input but you are hard coding the url for query. Does the url change?
10. ## clearing information

Your last line of code will keep appending the content with the previous content. Try something like: \$("#artist").html(title);

12. ## Repeating month

Thats true, you can do a simple date difference and return an array containing year and month. (see the PHP manual). Not sure what he is trying to do.
13. ## Repeating month

I think I understand now. If you have for example \$month = 36, that would be 2 years and 12 months, the maximum you need. So you would need to find the years and months up to that value: \$month= 25; function month(\$month){ if(\$month < 13) { \$month = \$month; \$year = 0; } elseif(\$month < 25){ \$month = \$month-12; \$year = 1; } elseif(\$month < 37 ){ \$month = \$month-24; \$year = 2; } echo 'Month: '.\$month.'<br>'; echo 'Year: '.\$year; } month(\$month); So, is this what you are trying to do? You can add \$year to the current or other date plus get the month. THis evaluates from the lowest to highest value of \$month.
14. ## Repeating month

If you are extracting month from date('m') it's never going to be greater than 12?
15. ## Repeating month

Are you just trying to return \$month plus 1 and if \$month is 13 it becomes 1? \$month = date('m'); function month(\$month){ \$month = ++\$month; if(\$month >12)\$month = 1; return \$month; } echo month(\$month);
×

• Chat