Website php issue

Hello, i design a web application for my collage project i build my website on my pc, for exeicute php code i use wamp server, there is no issue to execute php code, but when i upload those file on 000webhost server the website not works properly i got error ,if you need those php code i have no issue to share with you

Note:- here i got “Parse error: syntax error, unexpected end of file in /storage/ssd1/832/7384832/public_html/index.php on line 87” this error message but there is no problem i check several time

php code- https://1drv.ms/f/s!AvkYfDPLWkHApFsrYmVgmu5CvABo

website link- aliahclgproject.tk

You missed a } or ) somewhere :slight_smile:

i check several time i cant found any error, you can check, even the code is execute in pc very well…

here is the php code:

<?php
		    session_start();
			
			$i=$_SESSION['i'];
		    if($i==2 or $i==3 or $i==4 or $i==5 or $i==6 or $i==7)
			{
				if($i==3 or $i==4 or $i==5 or $i==6 or $i==7)
				{
					if($i==4 or $i==5 or $i==6 or $i==7)
					{
						if($i==5 or $i==6 or $i==7)
						{
							if($i==6 or $i==7)
							{
							    if($i=7)
								{
									header("location:html/page_7.php");
								}
								else{
									header("location:html/page_6.php");
								}
							}
							else{
								header("location:html/page_5.php");
							}
						}
						else{
							header("location:html/page_4.php");
						}
					}
					else{
						header("location:html/page_3.php");
					}
					
				}
				else{
					header("location:html/page_2.php");
				}
			}
			else{
			$i=1;
			$_SESSION['i']=$i;
			}
		 ?>

or open- https://1drv.ms/f/s!AvkYfDPLWkHApFsrYmVgmu5CvABo

i cant find any error, even after delete those line,
note: in my pc the code execute very well

green = comments

1 Like

lots of thank you infinity, now my issue is solved thank you very much…

i have one more question how hide the url
like to- http://aliahclgproject.tk/html/page_2.php
http://aliahclgproject.tk/html/page_2 or anythin i just want, user cannot identify the url. how i do that?

Hmm possibly using the rewrite rule with .htaccess but I’ve not got a clue, it would probably be somewhat like URL masking but unsure if apache will let you do that for security reasons but I could be wrong.

I know you could rewrite so if someone visits /html you could load content from /elsewhere but I’m not too sure on how to mask the URL in the browser for /html when you continue on with the survey.

@ckhawand any ideas?

you can use zendstudio write php code,this ide have syntax error tips and other error tips.

2 Likes

So you basically want to hide the .php extension?

i want 1.after reaching homepage user cannot access by url, also want to hide .php extensation
2. when any user put value in any page the he press submit button then he never go to previous page for change the input, (NOTE: i do this already with some php code using session, but i want better salutation for this if any body khow plz shere)

For 1:

RewriteEngine On

# browser requests PHP
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]

# check to see if the request is for a PHP file:
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^/?(.*)$ /$1.php [L]

thanks, it is good salutation for hide the extension thanks you ckhawand.:slight_smile:

1 Like