0

Hi,

I have been writing a PHP code. As I couldn't execute it locally (installation issue), I moved it to my server as a '.php' file. I haven't executed or run a php file in server before. Can anyone please say me how I can view the output of my script in the browser please?

Thanks!

2
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by kripssmart
Featured Replies
  • Right below # BEGIN SCRIPT place [code=php]error_reporting(E_ALL);[/code] Then follow the FAQ on the main page of the PHP forums Read More

0

Just go to the page in the browser, the same way you would locally except replace localhost with the domain name.

0

Hi.. Thanks for the quick reply..
But when I am opening it, even now its showing me a blank page. No error nothing! It was the same what I was viewing back in my local machine also.

0

This is what I was trying to do..

<?php


# BEGIN SCRIPT

    $XYZDBC=XYZDBConnect();
    $query="SELECT * from example";
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    mysql_close();



    $i=0;
    while($i<$num)
          {
              $infoCourse=mysql_result($result,$i,"course");
              $infoAssign=mysql_result($result,$i,"assignment");
              $infofirstName=mysql_result($result,$i,"firstName");            
              $infolastName=mysql_result($result,$i,"lastName");              

              echo "<b>Data</b><br><br><b>Users</b>";
              echo "$infofirstName $infolastName";
              $i++;
          }

?>

Edited by Nick Evan: Fixed formatting

1

Right below # BEGIN SCRIPT place

error_reporting(E_ALL);

Then follow the FAQ on the main page of the PHP forums

0

Hi..

I paced the 'error_reporting(E_ALL);' ... but couldn't find the FAQ that you were saying about...

0

Hi..

I paced the 'error_reporting(E_ALL);' ... but couldn't find the FAQ that you were saying about...

After you placed that in the code refresh the page. Instead of a white page you should see errors. If you get errors that mention something about a MySQL result resource follow the FAQ. If it is a different error post the error here.

0

Hi..

Its the same.. thats what I was saying.. Its blank page still.

Thanks..

0

Also put

ini_set('display_errors', 'On');

Below error_reporting(E_ALL);
If you still don't see any errors it could be because you're trying to call a function which obviously does not exist ( XYZDBConnect() )

0

@ShawnCplus

That worked.. Thanks..
It was the DB connection error. Let me try it once now..

Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.