Search found 15 matches

by RustyDoorknobs
Tue Jul 20, 2010 12:38 pm
Forum: PHP - Code
Topic: Sorting xml with simpleXML/xpath?
Replies: 1
Views: 1602

Sorting xml with simpleXML/xpath?

Hey, I have some xml, say: <Background> <Uses>14</Uses> </Background> <Background> <Uses>19</Uses> </Background> <Background> <Uses>3</Uses> </Background> How can I sort the xml from lowest Uses to highest? Maybe an xpath expression? Also, how could I just retrieve the bottom 2 Backgrounds, or the o...
by RustyDoorknobs
Fri Jan 15, 2010 4:18 pm
Forum: PHP - Code
Topic: HTTP_RAW_POST_DATA questions
Replies: 1
Views: 141

HTTP_RAW_POST_DATA questions

Hey, I am saving an image from a flash application I have created, It works but I want to be able to draw an image and embed it in my html file:   if (isset($GLOBALS["HTTP_RAW_POST_DATA"])) {     // get bytearray     $jpg = $GLOBALS["HTTP_RAW_POST_DATA"];       // add headers for...
by RustyDoorknobs
Tue Oct 06, 2009 7:32 pm
Forum: PHP - Code
Topic: php/mysql - didn't mean to make new topic - still need help
Replies: 1
Views: 179

php/mysql - didn't mean to make new topic - still need help

Thanks, I changed what you said. But it's still not working. I'll explain my full situation. I have a php script that gets image data and then echoes it. That part works fine. But, i want to be able to track how many times the script is accessed, so everytime the users accesses the script, I insert ...
by RustyDoorknobs
Tue Oct 06, 2009 6:48 pm
Forum: PHP - Code
Topic: Why is this PHP/mYsql not working?
Replies: 1
Views: 183

Why is this PHP/mYsql not working?

Hers my code   function genRandomString() { $length = 10; $characters = "0123456789abcdefghijklmnopqrstuvwxyz";     for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; }   return $string; } genRandomString();   mysql_select_db("DATABASE", $...
by RustyDoorknobs
Sun Sep 13, 2009 8:54 am
Forum: PHP - Code
Topic: webpage to image
Replies: 9
Views: 818

Re: webpage to image

How would I use that?
by RustyDoorknobs
Sat Sep 12, 2009 4:47 pm
Forum: PHP - Code
Topic: webpage to image
Replies: 9
Views: 818

Re: webpage to image

Its not so much a website as it is a piece of dynamic content, 250by150 pixels. I want people to be able to embed it in forums as an image.
by RustyDoorknobs
Sat Sep 12, 2009 4:28 pm
Forum: PHP - Code
Topic: webpage to image
Replies: 9
Views: 818

webpage to image

Hey guys, i have a php page that uses some url variables and stuff. i have it so you can embed this page as an iframe in a website, but i also want people to be able to embed it in a forum, so is there a way to convert a webpage to a .gif file? Like, a screenshot? I really don't want to use the GD l...
by RustyDoorknobs
Fri Sep 11, 2009 2:59 pm
Forum: PHP - Code
Topic: php trouble
Replies: 5
Views: 160

Re: php trouble

Thanks ya ol goose!
by RustyDoorknobs
Fri Sep 11, 2009 7:01 am
Forum: PHP - Code
Topic: php trouble
Replies: 5
Views: 160

Re: php trouble

I fixed up some stuff but i still get this: Fatal error: Call to a member function getElementsByTagName() on a non-object in /home/myavatar/public_html/cardtest2.php on line 42 I understand it's in my function, so heres my code: <?php       //Script (c) 2009 http://www.gamebattleshq.com     //includ...
by RustyDoorknobs
Thu Sep 10, 2009 8:01 pm
Forum: PHP - Code
Topic: php trouble
Replies: 5
Views: 160

php trouble

I keep getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/myavatar/public_html/cardtest2.php on line 18 Heres my code: <?php       //Script (c) 2009 http://www.gamebattleshq.com     //include into teamcards   //v1.0     //     //Load in DOM Doc $u = $_GET["u"] $s...
by RustyDoorknobs
Wed Sep 09, 2009 3:32 pm
Forum: PHP - Code
Topic: php xml
Replies: 1
Views: 173

Re: php xml

i tried that and now i get Parse error: syntax error, unexpected T_VARIABLE in /home/myavatar/public_html/getteamlogo.php on line 10 And heres my code: <?php //Load in user profile $u = $_GET["u"]; $p = new DOMDocument(); $p->validateOnParse = true; @$p->load( $u ); $logo_id="team-log...
by RustyDoorknobs
Tue Sep 08, 2009 8:43 pm
Forum: PHP - Code
Topic: php xml
Replies: 1
Views: 173

php xml

I'm trying to get the value of an src attribute for an img element by getting the element using its id. I keep getting: Fatal error: Call to undefined function getelementbyid() in /home/myavatar/public_html/getteamlogo.php on line 9 When i try it. Heres my code: <?php   //Load in user profile $u = $...
by RustyDoorknobs
Mon Sep 07, 2009 7:31 pm
Forum: PHP - Code
Topic: xml parsing trouble
Replies: 5
Views: 484

Re: xml parsing trouble

heres the code i tried: <?php //Load team profile page: $u = $_GET["u"]; $dom = new DOMDocument(); $dom->load( $u );   //Load in team avatar:   function find_elements_by_class($dom, $class_to_find) {   $found = array();   $elements = $dom->getElementsByTagName('*');   foreach($elements as ...
by RustyDoorknobs
Mon Sep 07, 2009 5:31 pm
Forum: PHP - Code
Topic: xml parsing trouble
Replies: 5
Views: 484

Re: xml parsing trouble

could you post some code? thanks
by RustyDoorknobs
Mon Sep 07, 2009 4:52 pm
Forum: PHP - Code
Topic: xml parsing trouble
Replies: 5
Views: 484

xml parsing trouble

Hey guys,
i wish php had a getelementbyclass function in the dom. I have an html page that im parsing and there is an image with a class attribute that is a unique value. Can i get the src attribute of the img, by finding the image using the value of its class attribute? Thanks.