Jump to content

Short Tags Problem


TDMGame

Recommended Posts

Ok, So i've a text base browser mafia game.

 

I hosted it on free servers and it worked perfectly.

I got myself a paid host and the problem started, only thing i get is a free white page.

www.thedaylightmafia.be

 

PHP short tags prevent Scorm packages from loading --> If your server is not configured to use php short tags then you just get a blank screen where the scorm object should be.

 

So after alot of search i found out that it is because of my SHORT TAGS.

To be honest, the live help at one.com is not great at all. I had to talk with 8 different persons no one could help.

 

But so they told me Short open tags are ON in default. And i can't add a .htacces to turn it off.

 

The problem is all my short tags are XML

 

Exemple =

 

<label for="gebruikersnaam"><?=$index1?> <input tabIndex="1" name="login" type="text" maxlength="15" value="" style="background:none;" class="width2"/></label> 

<label for="wachtwoord"><?=$index2?> <input tabIndex="2" name="pass" type="password" maxlength="25" value="" style="background:none;" class="width2" /></label>

<center><input type="submit" name="submit" style="width: 100; border:solid #FFF 0px;background:none; color:#ffffff;" value="<?=$index3?>"></center>

 

 

So if been looking for 2 days on google how to fix it, nothing helps...

 

Let's say i've opened about 30 pages on google with every explaination about Short tags alot of ppl are saying this

(<?php echo '<?xml version="1.0" encoding="ISO-8859-1"?>' ?> )

 

I tried this in top of my index perpahs i'm doing it wrong...

 

I'm a newbie in php so if any of you guys can help me, even if i have to change my 170 pages to make it work.

 

I consider just changing host, they'll refund me eventually but my domain is fixed for a year so it's kinda stupid.

 

Link to comment
Share on other sites

Your message makes no sense.  On one hand you state that short tags is on.  You are using short tags.  Clearly that is not the case. 

 

It is really very simple:

 

Short open tag: 

Full (normal) open tag):  <?php

 

Stop messing around with trying to make your pages xml, that has nothing to do with anything and will only make your problem worse.

 

What allows support for short open tags is a setting in the php.ini file for the server:

 

short_open_tag = On

 

That must be off.  If the hosting company is saying that they will not turn it on for you, then you have no choice other than to find another hosting company or move to a vps or dedicated host you control where you can make the settings whatever you wish.

 

The other possibility is that you simply search/replace through your entire code base and change to <?php. 

 

 

 

 

 

 

Link to comment
Share on other sites

To change out of short tags..

 

=$index1?>

 

For example, should be

 


 

Hey Alex, as far as I know the alternative syntax will still work with our without the shorttags.  It definitely works for control structures.

Link to comment
Share on other sites

To change out of short tags..

 

<?=$index1?>

 

For example, should be

 

<?php echo $index1; ?>

 

I did that without the ';' maybe that's the reason it didnt work i'll try that out but then i need to do it on about 200 php pages and i've 6500+ vars :)

 

--------

 

Your message makes no sense.  On one hand you state that short tags is on.  You are using short tags.  Clearly that is not the case. 

 

It is really very simple:

 

Short open tag:  <?

Full (normal) open tag):  <?php

 

Stop messing around with trying to make your pages xml, that has nothing to do with anything and will only make your problem worse.

 

What allows support for short open tags is a setting in the php.ini file for the server:

 

short_open_tag = On

 

That must be off.  If the hosting company is saying that they will not turn it on for you, then you have no choice other than to find another hosting company or move to a vps or dedicated host you control where you can make the settings whatever you wish.

 

The other possibility is that you simply search/replace through your entire code base and change <? to <?php. 

 

 

 

I don't have acces to my ini indeed, but the thing is i've a file like this

 

$astat34 = "login";

$astat35 = "person";

$astat36 = "code";

$astat37 = "area";

$astat38 = "crew";

$astat39 = "Who has a swissbank";

$astat40 = "Pincode";

$astat41 = "Bank Account";

$astat42 = "Bank";

 

and that for 6500 lines

So the short tags i'm usin are all to show text so the <?php will not work if i'm right :P

 

 

Link to comment
Share on other sites

$astat34 = "login";
$astat35 = "person";
$astat36 = "code";
$astat37 = "area";
$astat38 = "crew";
$astat39 = "Who has a swissbank";
$astat40 = "Pincode";
$astat41 = "Bank Account";
$astat42 = "Bank";

 

and that for 6500 lines

So the short tags i'm usin are all to show text so the <?php will not work if i'm right :P

 

No you are not right.

 

That has nothing to do with short tags.  Those are variable assignments.

 

PHP allows you to mix html with php.  The way it knows that you have a block of php code instead of html is that you have a start/end php block.

 

some html




 more html here 


 

 

That is the issue.  Short tags does the same thing, only you omit the php from the tags, but php needs to be configured to allow it.  We've already been over this. 

 

Short tags example:

 

 This is html 

= "This is the same as using echo" ?>




 See more html in the same .php document! 

 

If it's not configured you can't use the short tag syntax to start a php block, and your code uses short tags. 

Link to comment
Share on other sites

I tried what you said alex i keep getting a blank page...

 

You probably have a syntax error.  Did you remove the xml header as well?

 

yes i did :)

 

And if you look at www.thedaylightmafia.be you can see i have no error ... Just a blank screen, php error message are turned on so if there was an error we would see it.

 

I'm also sure i didnt miss out one, i triple checked it to be sure.

Link to comment
Share on other sites

But anyway you said what i had to do, and that's what i will do. Only thing they can say is that they don't support scripting help while they are the ones messing it up because they don't want to let me turning it off. So i should just change host.

Link to comment
Share on other sites

The fact that there's absolutely nothing being sent to the browser is a fairly strong indication that there is indeed a fatal parse error. How did you turn on error reporting, via php.ini or in the script with ini_set() and error_reporting()?

Link to comment
Share on other sites

I tried what you said alex i keep getting a blank page...

 

You probably have a syntax error.  Did you remove the xml header as well?

 

yes i did :)

 

And if you look at www.thedaylightmafia.be you can see i have no error ... Just a blank screen, php error message are turned on so if there was an error we would see it.

 

I'm also sure i didnt miss out one, i triple checked it to be sure.

 

 

You have a runtime error.  It is probably in the error log for the server.  On shared hosting you can't get access to that most times.  Shared hosting is crap more times than not, but like most things in life you get what you paid for.  Since you know that your code requires php short tags to be enabled, at least you can check with other potential hosting companies to make sure they support it, before you move somewhere else.

Link to comment
Share on other sites

A) You should get your script working on a development system that has the same php.ini settings as your web hosting,

 

B) It will take you about 2 minutes (that includes the time needed to open the editor and find the menu item) to get a programming editor like Notepad++ to do a search/replace through all the files to change all the <?= into <?php echo and to change all the <? into <?php tags.

 

C) The php tags in your code will then work on any server that has php installed and you won't need to waste an more time dealing with short open tags.

 

D) There may be other settings or needed php extensions that are causing the fatal parse/runtime error/white-page and you could have the same problem on any web host and it is always better to troubleshoot what is causing a problem and solve it then to try to work around the problem (jumping to a different web host probably won't solve your problem.)

Link to comment
Share on other sites

At PFM, I could do that but that would mean i would change everything without having a look at what i change and that might bring up some trouble later which i prefer to avoid. I asked for refund and i'm now looking for new host but i ask the question before i pay. That was a stupid newbie error. But hey you got a learn it someway :)

 

Thanx for all your help guys, for now it should be ok.  8)

Link to comment
Share on other sites

So, did you check using a phpinfo(); statement to see if the short open tag setting is on or not? It may not be what is causing your php code to fail.

 

Edit: and while you are at it, what does a phpinfo() statement show for the error_reporting and display_errors settings?

Link to comment
Share on other sites

So, did you check using a phpinfo(); statement to see if the short open tag setting is on or not? It may not be what is causing your php code to fail.

 

Edit: and while you are at it, what does a phpinfo() statement show for the error_reporting and display_errors settings?

 

This ^^^

 

Based on a lot of things that have come up in this thread, I share PFMaBiSmAd's concern that there are other problems. However, with that said, a crap host is a crap host, and as far as I'm concerned, very few shared hosting companies aren't crappy.  There's just no way to provide good support to people who are paying $7/ month. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.