Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

PHP Include causing error 500

I'm a total noob to php, still learning.

trying to include air2.php in my index, they're all located in the same dir.

Code
<html>
<?php

This is a test script for the On-Air System.

include 'air2.php'
?>
</html>

Whenever I load air2.php manually, it loads just fine.

9% BTC > PP or PP > BTC
Code
<html>

This is a test script for the On-Air System.

<?php include 'air2.php'; ?>
</html>
 
this should work for you
[Image: zqO2UXJ.gif]

(May 9, 2018 02:18 PM)ThomasGB Wrote:  
Code
<html>

This is a test script for the On-Air System.

<?php include 'air2.php'; ?>
</html>
 
this should work for you

You're a real fucking G.

9% BTC > PP or PP > BTC
Just some clarification, you added "This is a test script for the On-Air System." in the PHP code. This is not valid PHP code. It looks like it is meant to be outside, judging by later responses, but if you do want to do comments in PHP, you just add // before.
PHP Code

<?php 
// This is a comment 

hi
You didn't include a semi-colon after the include statement. PHP REQUIRES a statement end bracket, unlike javascript.

Code
include('page.php');

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
(May 9, 2018 03:46 PM)Anxuein Wrote:  Just some clarification, you added "This is a test script for the On-Air System." in the PHP code. This is not valid PHP code. It looks like it is meant to be outside, judging by later responses, but if you do want to do comments in PHP, you just add // before.
PHP Code

<?php 
// This is a comment 

I honestly have no idea how I missed this, lol.


(May 9, 2018 04:33 PM)Nachfolger Wrote:  You didn't include a semi-colon after the include statement. PHP REQUIRES a statement end bracket, unlike javascript.

Code
include('page.php');

Gotcha'. Got this working - sorta. Thanks everyone for their help.

9% BTC > PP or PP > BTC


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by Jack DrakeAug 30, 2019 08:12 PM 20 496 Aug 30, 2019 08:12 PM
Last Post: sdk
[PHP] by CryptoLayerFeb 19, 2019 03:03 PM 2 190 Feb 19, 2019 03:03 PM
Last Post: newQuery
[PHP] by .eXeJul 6, 2018 08:28 AM 6 250 Jul 6, 2018 08:28 AM
Last Post: .eXe