Jump to content

Archived

This topic is now archived and is closed to further replies.

itzikc20

How do i Save information from PHP files?

Recommended Posts

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=60302
Someone Can help me? i am new here :)

Share this post


Link to post
Share on other sites
do you mean that you want to save something to this line or ?

Share this post


Link to post
Share on other sites
[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

Share this post


Link to post
Share on other sites
How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation.

Share this post


Link to post
Share on other sites
[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 :>

Share this post


Link to post
Share on other sites
$file_array = file("file.html");
$variable = $file_array[18];

That would put the line 19 to $variable

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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 :P
i 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 10

Warning: 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]

Share this post


Link to post
Share on other sites
[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.html
you 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.php
my question is how can i save the information that in line 19 and display it in my page...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[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

Share this post


Link to post
Share on other sites
Yea I know I am working on it. I guess I should test it before posting..lol

Share this post


Link to post
Share on other sites
[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 19
http://www.gamer.co.il/gamer2/php/memberslist2.php?userid=94980

Share this post


Link to post
Share on other sites

×

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.