itzikc20 Posted July 31, 2006 Share Posted July 31, 2006 I want to save information that exist in PHP to variable... How i doing it?For example, I want to saved the information on line 19 on this PHP File:http://www.gamer.co.il/gamer2/php/memberslist2.php?userid=60302Someone Can help me? i am new here :) Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/ Share on other sites More sharing options...
tomfmason Posted July 31, 2006 Share Posted July 31, 2006 do you mean that you want to save something to this line or ? Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66362 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=tomfmason link=topic=102440.msg406474#msg406474 date=1154355537]do you mean that you want to save something to this line or ?[/quote]I what to save the information that in the line 19...for example if in line 19 write "2222", i can save "2222" in a variable Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66365 Share on other sites More sharing options...
wildteen88 Posted July 31, 2006 Share Posted July 31, 2006 How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation. Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66366 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=wildteen88 link=topic=102440.msg406478#msg406478 date=1154355810]How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation.[/quote]sorry for this :|this line was created by PHP....but i think that this isnt matter, i what just the command to save the text that in line 19 on the HTML file :> Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66368 Share on other sites More sharing options...
Ifa Posted July 31, 2006 Share Posted July 31, 2006 $file_array = file("file.html");$variable = $file_array[18];That would put the line 19 to $variable Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66369 Share on other sites More sharing options...
wildteen88 Posted July 31, 2006 Share Posted July 31, 2006 So you just want just line 19 to be displayed in the html file and not all the other lines correct? In that case could you provide the code that generates that html code. With no code to work with we cannot suggest anythink. Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66371 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=Ifa link=topic=102440.msg406481#msg406481 date=1154356035]$file_array = file("file.html");$variable = $file_array[18];That would put the line 19 to $variable[/quote]thanks!but i got some eror :Pi have to say that the HTML file isnt in my server and this is the eror:[code]Warning: file(): URL file-access is disabled in the server configuration in /home/i/itzikc20/www/gamer/stars.php on line 10Warning: file(http://www.gamer.co.il/gamer2/php/memberslist.php): failed to open stream: no suitable wrapper could be found in /home/i/itzikc20/www/gamer/stars.php on line 10[/code] Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66375 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=wildteen88 link=topic=102440.msg406483#msg406483 date=1154356113]So you just want just line 19 to be displayed in the html file and not all the other lines correct? In that case could you provide the code that generates that html code. With no code to work with we cannot suggest anythink.[/quote]I created it:http://itzikc20.phpnet.us/gamer/stars.htmlyou write your ID and this should give you your "stars"...the stars is providing in line 19 on this page:http://www.gamer.co.il/gamer2/php/memberslist2.phpmy question is how can i save the information that in line 19 and display it in my page... Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66379 Share on other sites More sharing options...
tomfmason Posted July 31, 2006 Share Posted July 31, 2006 maybe something like this would help[code=php:0]<?php$file = 'yourfile.html'; $fp = fopen($file, 'r+');while (!feof($fp)){ $line = trim(fgets($fp, 1024)); if ($line == 'memberprops[19]'){ $fpos = ftell($fp); echo "$fpos"; }} fclose($fp);?>[/code]I may be way off base but this may help. Give it a try Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66381 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=tomfmason link=topic=102440.msg406494#msg406494 date=1154356834]maybe something like this would help[code=php:0]<?php$file = 'yourfile.html'; $fp = fopen($file, 'r+');while (!feof($fp)){ $line = trim(fgets($fp, 1024)); if ($line == 'memberprops[19]'){ $fpos = ftell($fp); echo "$fpos"; }} fclose($fp);?>[/code]I may be way off base but this may help. Give it a try [/quote]I tried, not work :P Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66389 Share on other sites More sharing options...
tomfmason Posted July 31, 2006 Share Posted July 31, 2006 Yea I know I am working on it. I guess I should test it before posting..lol Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66393 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 [quote author=tomfmason link=topic=102440.msg406507#msg406507 date=1154357795]Yea I know I am working on it. I guess I should test it before posting..lol[/quote]thanks :P this is a great forum with great people :)Look this is the page that i whant from it the line 19http://www.gamer.co.il/gamer2/php/memberslist2.php?userid=94980 Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66394 Share on other sites More sharing options...
itzikc20 Posted July 31, 2006 Author Share Posted July 31, 2006 this past a paper :| Quote Link to comment https://forums.phpfreaks.com/topic/16103-how-do-i-save-information-from-php-files/#findComment-66534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.