Jump to content

How do i Save information from PHP files?


itzikc20

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 :)
Link to comment
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
Link to comment
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 :>
Link to comment
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]
Link to comment
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...
Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.