4 Replies - 2051 Views - Last Post: 12 September 2010 - 11:05 PM Rate Topic: -----

#1 Longblob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 12-December 09

[Help] Fail To Upload PHP File To The Hosting

Posted 08 September 2010 - 09:03 PM

I have created a web and i have succesfully tested it on my wampserver before.but when i upload the files to hosting,i got an error in index.php file :

Fatal error: Call to undefined function phpheader() in /home/daroza/public_html/avalonwarriors.com/index.php on line 1

this is my index.php file :

<?php //->fatal error here

header('Location:utama.php');

?>



this is my utama.php file :

<?php
include "koneksi.php";
include "atas.php";

echo "<table bgcolor=#121212 width=100%><tr><td>";
echo "<center>";
echo "<form action=login.php method=post><div id='login'>";
echo "Username :<input type=text name=username>";
echo "Password :<input type=password name=password>";
echo "<input type=submit value=LOGIN name=login>";
echo "</form><br><br>";
echo "</div>";
echo "</center>";
echo "</td></tr></table>";

echo "<table width=100% border=0><tr><td width=60% bgcolor=#04150c><center>";
echo "<img src=images/armoredwarrior.jpg><br>";
echo "<h1><font color=#7bf0e1>AVALON WARRIOR</font></h1>";
echo "<h2><u><font color=#63afd3>Free Online Game</font></u></h2>";
echo "<div id='huruf'>WELCOME TO AVALON</div></center>";

include "iklan.php";
include "footer.php";

echo "</body>";

?>



i don't know why i have fatal error on my script when upload it on the real hosting,please help me how to fix it? thank you

This post has been edited by no2pencil: 08 September 2010 - 09:08 PM
Reason for edit:: re-Added code tags


Is This A Good Question/Topic? 0
  • +

Replies To: [Help] Fail To Upload PHP File To The Hosting

#2 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6576
  • View blog
  • Posts: 30,729
  • Joined: 10-May 07

Re: [Help] Fail To Upload PHP File To The Hosting

Posted 08 September 2010 - 09:06 PM

phpheader() is called but not defined.

PHP can't magically know what it is or what it's supposed to do. Where does this function come from? Is it from an installed package or plugin that you can in one environment & not the other?

Also, please stop un-editing your post. Code tags make ready multiple lines of code wonderfully easy. Thank you.

** Edit **

Let me take another stab at this... I don't see the text "phpheader" in your code anywhere. My guess is that you have a segment of code in one of your included files that is making a call to header() & is on the same line as a starting php call, & the space got left out.

<?php header()?> became <?phpheader()?>

The above is just a guess as, again, I don't see phpheader anywhere in your code.
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6576
  • View blog
  • Posts: 30,729
  • Joined: 10-May 07

Re: [Help] Fail To Upload PHP File To The Hosting

Posted 08 September 2010 - 09:16 PM

View PostLongblob, on 08 September 2010 - 10:03 PM, said:

this is my index.php file :

<?php //->fatal error here

header('Location:utama.php');

?>


What text editor did you use? it most likely foobar'ed your return, then couldn't read it & php space header() became phpheader()
Was This Post Helpful? 0
  • +
  • -

#4 Longblob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 12-December 09

Re: [Help] Fail To Upload PHP File To The Hosting

Posted 10 September 2010 - 05:17 AM

View Postno2pencil, on 08 September 2010 - 08:06 PM, said:

phpheader() is called but not defined.

PHP can't magically know what it is or what it's supposed to do. Where does this function come from? Is it from an installed package or plugin that you can in one environment & not the other?

Also, please stop un-editing your post. Code tags make ready multiple lines of code wonderfully easy. Thank you.

** Edit **

Let me take another stab at this... I don't see the text "phpheader" in your code anywhere. My guess is that you have a segment of code in one of your included files that is making a call to header() & is on the same line as a starting php call, & the space got left out.

<?php header()?> became <?phpheader()?>

The above is just a guess as, again, I don't see phpheader anywhere in your code.


i was upload it over 29 .php files,1 images folder,without htaccess file,without admin content,i used Dreamweaver text editor.i was successfully functional tested my project in my wampserver but facing many failure when i upload it in the hosting.there are my errors :

1.index.php

Quote

Fatal error: Call to undefined function phpheader() in /home/daroza/public_html/avalonwarriors.com/index.php on line 1


2.utama.php

Quote

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/daroza/public_html/avalonwarriors.com/utama.php on line 1


3.registrasi.php

Quote

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/daroza/public_html/avalonwarriors.com/registrasi.php on line 1


registrasi.php code :
<?php
include "koneksi.php";
include "atas.php";

echo "<body bgcolor='black'>";
echo "<table width=100% border=0><tr><td width=60% bgcolor=#04150c><center>";
$gender = array("Male","Female");
$bulan  = array("Jan","Feb","March","April","May","June","July","Aug","Sep","Oct","Nov","Des");
$nations = array("Unicorn","Dragon");

/*other codes*/

?>


4.proreg.php

Quote

Fatal error: Call to undefined function session_start() in /home/daroza/public_html/avalonwarriors.com/proreg.php on line 1


proreg.php code :
<?php
session_start();
include "koneksi.php";

include "atas.php";
echo "<body bgcolor='black'>";

/*other codes*/

?>


5.login.php

Quote

Fatal error: Call to undefined function session_start() in /home/daroza/public_html/avalonwarriors.com/login.php on line 1


6.market.php

Quote

Fatal error: Call to undefined function session_start() in /home/daroza/public_html/avalonwarriors.com/market.php on line 1


market.php code :
<head>
<link href="polesan.css" rel="stylesheet" type="text/css"/>
</head>

<?php
session_start();
include "koneksi.php";

/*other codes*/

?>


7.inventory.php

Quote

Fatal error: Call to undefined function session_start() in /home/daroza/public_html/avalonwarriors.com/inventory.php on line 1


8.and all other files have similar mistake too

What's wrong with my script??

This post has been edited by Longblob: 10 September 2010 - 05:22 AM

Was This Post Helpful? 0
  • +
  • -

#5 guahguahmonster  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 68
  • View blog
  • Posts: 209
  • Joined: 29-August 07

Re: [Help] Fail To Upload PHP File To The Hosting

Posted 12 September 2010 - 11:05 PM

If session_start() is undefined, your host doesn't support the session extension to PHP. You'll have to find a new host, or ask them to fix that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1