Jump to content


Photo

How do i Save information from PHP files?


  • Please log in to reply
13 replies to this topic

#1 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:00 PM

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

#2 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 31 July 2006 - 02:18 PM

do you mean that you want to save something to this line or ?

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#3 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:21 PM

do you mean that you want to save something to this line or ?

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

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 July 2006 - 02:23 PM

How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation.

#5 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:25 PM

How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation.

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

#6 Ifa

Ifa
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts
  • LocationRauma, Finland

Posted 31 July 2006 - 02:27 PM

$file_array = file("file.html");
$variable = $file_array[18];

That would put the line 19 to $variable
I'm just a guy who likes to code for fun...

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 July 2006 - 02:28 PM

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.

#8 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:33 PM

$file_array = file("file.html");
$variable = $file_array[18];

That would put the line 19 to $variable

thanks!
but i got some eror :P
i have to say that the HTML file isnt in my server and this is the eror:
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


#9 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:37 PM

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.

I created it:
http://itzikc20.phpn...amer/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....emberslist2.php
my question is how can i save the information that in line 19 and display it in my page...

#10 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 31 July 2006 - 02:40 PM

maybe something like this would help

<?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);
?>

I may be way off base but this may help. Give it a try

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#11 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:50 PM

maybe something like this would help

<?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);
?>

I may be way off base but this may help. Give it a try

I tried, not work :P


#12 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 31 July 2006 - 02:56 PM

Yea I know I am working on it. I guess I should test it before posting..lol

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#13 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 02:59 PM

Yea I know I am working on it. I guess I should test it before posting..lol

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....hp?userid=94980

#14 itzikc20

itzikc20
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 July 2006 - 06:51 PM

this past a paper :|




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users