Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Defcon
Regular
Regular



Joined: Mar 10, 2005
Posts: 90

PostPosted: Wed Jun 27, 2007 1:07 pm Reply with quote

Hye all,

I would like to ask about echo "<--statement==>";

Ok my senario let say like this i got a file name as datax01.php & script.php

Let say on script.php i got a code to use echo. So how from echo i can recall datax01.php to view on that script?

My theory is to use $ let say script like this

Code:


<?php

$data = "datax01.php";
echo "$data";
?>


I know my theory/code is wrong so how i can do that? My limitation in this issue is i must view/recall a data from echo.

Thanxs.

*datax01.php is containing a PHP script where to process a submit form and also PHP if..else syntax


Last edited by Defcon on Wed Jun 27, 2007 1:37 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Wed Jun 27, 2007 1:31 pm Reply with quote

See the PHP functions file(), file_get_contents(), readfile(), etc....

_________________
GCalendar - An Event Calendar for PHP-Nuke
Member_Map - A Google Maps Nuke Module 
View user's profile Send private message
Defcon







PostPosted: Wed Jun 27, 2007 1:35 pm Reply with quote

Gremmie wrote:
See the PHP functions file(), file_get_contents(), readfile(), etc....


Thanxs Gremmie for ur reply. I already make a study n research by a PHP functions that you give. But i still dont understand. Let say we use a funtions readfile() so is that u mean my code will be like this?

Code:


<?php

echo "readfile()";

?>


???
 
Gremmie







PostPosted: Wed Jun 27, 2007 2:00 pm Reply with quote

What are you trying to do exactly? Read the contents of the datax01.php file and echo it out?

Or read the contents of datax01.php and execute it?

Or....?
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Jun 27, 2007 2:09 pm Reply with quote

Its very easy to code share, if that's what you're trying to do

in script.php
Code:


include('datax01.php');

is all that is necessary, it will execute all the code in that file

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
Defcon







PostPosted: Wed Jun 27, 2007 7:33 pm Reply with quote

Gremmie wrote:
What are you trying to do exactly? Read the contents of the datax01.php file and echo it out?

Or read the contents of datax01.php and execute it?

Or....?


Thanxs again Gremmie, yes i want to execute it inside echo. Can it be done?
 
Defcon







PostPosted: Wed Jun 27, 2007 7:40 pm Reply with quote

evaders99 wrote:
Its very easy to code share, if that's what you're trying to do

in script.php
Code:


include('datax01.php');

is all that is necessary, it will execute all the code in that file


Hye evaders99, thanxs for ur reply. Actually i would like to view a data/content from execute/process form on datax01.php. My limitation is i have to put it on echo because my real scenario currently that web base system(script.php) giving output with echo, so now i have to update it with process form on datax01.php to put on that echo. I cant using "include" unless it can be declare it and call into echo such as

Code:


<?php
echo "include ('datax01.php')";
?>


*i know that script above is wrong.

Thanxs
 
evaders99







PostPosted: Wed Jun 27, 2007 8:58 pm Reply with quote

Am I to understand that datax01.php executes PHP code and outputs data, which then you want script.php to echo? Why doesn't datax01.php echo its output if it provides output data?
Or just store as a variable and pass that for any other PHP script to use
 
Defcon







PostPosted: Fri Jun 29, 2007 2:30 am Reply with quote

evaders99 wrote:
Am I to understand that datax01.php executes PHP code and outputs data, which then you want script.php to echo? Why doesn't datax01.php echo its output if it provides output data?
Or just store as a variable and pass that for any other PHP script to use


Thanxs again to evaders99 and all of replies from friends here. I really sorry if this question make hard for you to answer. Well i will try all of the best with this posting. Ok now i tell a 100% real case scenario. What i would like to do now is a develop a song request script to work out with Shoutcast service.

I already do a request form base script name file as request.php.
That script can be download n view here --> [ Only registered users can see links on this board! Get registered or login! ] / [ Only registered users can see links on this board! Get registered or login! ]

I cant post that script here or i will ban from here.

However that web page also i need to view a Shoutcast radio statistic so here is full Shoutcast radio statistic:

Code:


<?php
include ("config.php");

if ($scsuccs!=1) {
if($streamstatus == "1"){
if (isset($dj)) {
echo "
<b>Listeners:</b> $currentlisteners&nbsp;&nbsp<br>
<b>Current Stream URL</b>: <a href=\"http://$scip:$scport/listen.pls\">&nbsp;http://$scip:$scport/listen.pls &nbsp;</a><br>
<b>Current Stream Title</b>: $servertitle<br>
<b>Current Song:</b> $song[0]<br>
<b>Current DJ</b>: $name<br>
<b>Current DJ ID</b>: $dj<br>
";

if ((empty($aimdb)) && (isset($aim) && $aim) && ($aim != "N/A")) {
$aimdb = $aim;
}

if ((empty($icqdb)) && (isset($icq) && $icq)) {
$icqdb = $icq;
}

if (isset($aimdb) && $aimdb) {
echo "<b>AIM</b>: $aimdb<br>";
}

if (isset($msn) && $msn) {
echo "<b>MSN</b>: $msn<br>";
}

if (isset($yim) && $yim) {
echo "<b>YIM</b>: $yim<br>";
}

if (isset($icqdb) && $icqdb) {
echo "<b>ICQ</b>: $icqdb<br>";
}
if ($showsetby == 1) {
echo "<br><br><b>This DJ was found by checking:</b> $setby";
}

} else {
echo "<center><b>A DJ of LepakFM.net is not currently signed on to the system or not in duty today. LepakFM.net radio services may running on auto run mode. <br>Please check again later.</b></center><br>
<br><b>Current Stream Title</b>: $servertitle<br>
<b>Current Song:</b> $song[0]<br>";
}
} else {
echo "<b>A DJ of LepakFM.net is not currently connected to the radio or not in duty today. Please check again later.</b>";
}
} else {
echo "<b>Lepakfm.net radio services is currently down. Please check again later.</b>";
}
echo "<br><br><font size=\"-1\"><strong>Powered by $version - &copy;2007 sTup|D - <a href=\"http://www.lepakfm.net\" target=\"_blank\">www.lepakfm.net</a></strong></font>";
?>


So my problem is how to "insert request.php" into this echo:

Quote:

[code]
<?php
include ("config.php");

if ($scsuccs!=1) {
if($streamstatus == "1"){
if (isset($dj)) {
echo "
[<!-- I WANT TO PUT REQUEST SCRIPT HERE ---->
<br>
<b>Listeners:</b> $currentlisteners&nbsp;&nbsp<br>
<b>Current Stream URL</b>: <a href=\"http://$scip:$scport/listen.pls\">&nbsp;http://$scip:$scport/listen.pls &nbsp;</a><br>
<b>Current Stream Title</b>: $servertitle<br>
<b>Current Song:</b> $song[0]<br>
<b>Current DJ</b>: $name<br>
<b>Current DJ ID</b>: $dj<br>
";


So may i know how i can do it?

Thanxs
 
evaders99







PostPosted: Fri Jun 29, 2007 8:26 am Reply with quote

You should just be able to do (outside the echo statement of course.. you just need to put it above the echo if I'm reading the code correctly)
Code:


include('request.php');

That seems to be the want you want, the code to executes there were the include is.
 
Defcon







PostPosted: Fri Jun 29, 2007 11:10 am Reply with quote

evaders99 wrote:
You should just be able to do (outside the echo statement of course.. you just need to put it above the echo if I'm reading the code correctly)
Code:


include('request.php');

That seems to be the want you want, the code to executes there were the include is.


Ic.... Thanxs again evaders99
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©