Jump to content

php noob


anthony_d

Recommended Posts

Hello, I'm new to this forum, and I have just spend half an hour typing out my question as complete as possible, and just before I wanted to hit the "Post" button, I pressed "why not?" out of curiousity @

Read the rules before you post! We will NOT edit/delete your content (why not?)! so I lost everything I wrote.

 

Anyway. I'll shortly retype it all: I'm a Dutch student - therefore my English isn't that good, I'm sorry for that - and for school, I have to make a website. It has to include a CMS system, a search-box, a contactform, Google Analytics and Google Maps.

 

In the meantime, I don't even seem to be able to write 3 php lines properly. When I tried to, and uploaded my work, my site (www.amstel-webdesign.nl) told me:

 

Parse error: syntax error, unexpected T_STRING in /home/amstelwd/domains/amstel-webdesign.nl/public_html/index.php on line 119

 

Hereunder, please find the source:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Amstel webdesign & graphics</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- header start -->
<div id="header">
    	<ul>
        	<li><a href="">Homepage</a></li>
        	<li><a href="">Over ons</a></li>
    		<li><a href="">Webdesign</a></li>
        	<li><a href="">Graphics</a></li>    	
        	<li><a href="">Prijzen</a></li>
        	<li><a href="">Contact</a></li>
         </ul>
</div>
<!-- header end -->	
    
<!-- body start -->
<div id="body">
	<div class="left">
        	<a href="#" title="Over ons"><img src="images/hobby_profession.png" alt="Onze hobby is ons beroep geworden..." width="780" height="305" border="0" /></a><br class="spacer" />
          <br class="spacer" />
		<h2><span>Home</span>page</h2><br /> <br />
		<p>Is het niet ieders droom om van je hobby je werk te maken? Wij, webdesigners van Amstelland, zijn erin geslaagd die droom waar te maken. Als kleine jongetjes vonden wij het al leuk om met computers te spelen, inmiddels doen wij dat als werk. Maar dat betekent niet dat wij ons werk niet serieus nemen. Juist omdat wij zo van webdesign houden, zullen wij er alles aan doen om ervoor te zorgen dat het u aan niets ontbreekt. Wij zijn toegewijde professionals die plezier hebben in hun werk. En dat merkt u ook! Wij zijn  niet vies van zware opdrachten of lastige problemen, we zien het als een uitdaging... </p>
            <p>Heeft u al een website, dan kunt u deze gratis door ons laten testen. Wij testen op een aantal essentiële onderdelen van uw site. U krijgt snel een kort, duidelijk en uiteraard vrijblijvend rapport, met daarin eventueel te verbeteren punten. Daarna heeft u de mogelijkheid om ons de punten in kwestie te laten verbeteren, en de website te laten onderhouden, tegen een scherp tarief. Heeft u interesse in een dergelijke test, maakt u dan een afspraak met ons. Als u het contactformulier invult, te vinden onder de menuknop <a href="">contact</a>, dan nemen wij zo spoedig mogelijk contact met u op.
            <br />
	  </p>


	</div>
	<div class="right">
		<h2><span>Diensten</span></h2><br />
		<ul>
			<li><a href="#">Webdesign </a></li>
			<li><a href="#">Consultancy  </a></li>
			<li><a href="#">Onderhoud </a></li>
			<li><a href="#">CMS </a></li>
			<li><a href="#">SEO  </a></li>
			<li><a href="#">Webshop ontwikkeling </a></li>
			<li><a href="#">Contactformulier ontwikkeling </a></li>
                <li><a href="#">Zoekfunctie ontwikkeling </a></li>
                <li><a href="#">Google Analytics </a></li>
			<li><a href="#">Google Maps  </a></li>
			<li><a href="#">Mobiel </a></li>
			<li><a href="#">Huisstijl ontwikkeling </a></li>
			<li><a href="#">Drukwerk  </a></li>
			<li><a href="#">Vertalingen </a></li>                
		</ul>
            <br /><br />
            
            <form method="post" action="#" name="search" class="search">
			<label><span>Zoek</span>functie</label>
			<br class="spacer" />
			<input name="search" type="text" id="search" />
			<a href="#" title="Advance search">Geavanceerd zoeken</a><input name="" type="image" src="images/search_btn.gif" title="Search"  class="searchBtn"/>
		</form>
		<form method="post" action="#" name="login" class="login">
			<h2><span>Log-</span>in</h2><br class="spacer" />
			<label>Naam</label><br class="spacer" />
			<input name="name" type="text" id="name" /><br class="spacer" />
			<label>Wachtwoord</label><br class="spacer" />
			<input name="password" type="password" id="password" /><br class="spacer" />
			<input name="" type="image" src="images/login_btn.gif" title="Login" class="loginBtn" />
		</form><br class="spacer" />
	</div>
<br class="spacer" /></div>
<!-- body end -->
    
<!-- footer start -->
<div id="footer">
<div class="footer">
	<div id="nav_left">
            	<a href="" title="Home">Home</a> <br />
            	<a href="" title="Over ons">Over ons</a> <br />
			<a href="" title="Webdesign">Webdesign</a> <br />
			<a href="" title="Graphics">Graphics</a> <br />
			<a href="" title="Prijzen">Prijzen</a> <br />
			<a href="" title="Contact">Contact</a>
            <br class="spacer" />		
        </div>		
            <div id="nav_center">
		  <a href="">Webdesign</a> <br />
              <a href="">Consultancy</a> <br />
              <a href="">Onderhoud</a> <br />
              <a href="" title="Content Management System">CMS</a> <br />
              <a href="" title="Search Engine Optimization / Zoekmachine Optimalisatie">SEO</a> <br />
              <a href="">Webshop ontwikkeling</a>
            </div>
            	<div id="nav_right">
                	<a href="">Google Analytics</a> <br />
                    <a href="">Google Maps</a> <br />
                    <a href="">Mobiel</a> <br />
                    <a href="">Huisstijl ontwikkeling</a> <br />
                    <a href="">Drukwerk</a> <br />
                    <a href="">Vertalingen</a>
                </div>

    </div>
</div>
<!-- footer end -->		
</body>
</html>

 

The php part is marked in red (I hope)... And line 119 is                  echo ("Amstel_webdesign_graphics" date ("Y"))

 

Could someone please tell me what I'm doing wrong, and what it's all supposed to be?

 

Before I uploaded my index.html with the php lines, my piece was xhtml 1.0 strict and had a valid CSS. I left part of the footer out, so if that created any mistakes (a </div> too many or not enough or such), it probably has nothing to do with the php fail.

 

Thanks so much in advance.

 

Anthony

 

Link to comment
Share on other sites

Oh crap, I deleted it with the last part of the footer, I'm sorry.

 

	<!-- footer start -->
<div id="footer">
<div class="footer">
	<div id="nav_left">
            	<a href="" title="Home">Home</a> <br />
            	<a href="" title="Over ons">Over ons</a> <br />
			<a href="" title="Webdesign">Webdesign</a> <br />
			<a href="" title="Graphics">Graphics</a> <br />
			<a href="" title="Prijzen">Prijzen</a> <br />
			<a href="" title="Contact">Contact</a>
            <br class="spacer" />		
        </div>		
            <div id="nav_center">
		  <a href="">Webdesign</a> <br />
              <a href="">Consultancy</a> <br />
              <a href="">Onderhoud</a> <br />
              <a href="" title="Content Management System">CMS</a> <br />
              <a href="" title="Search Engine Optimization / Zoekmachine Optimalisatie">SEO</a> <br />
              <a href="">Webshop ontwikkeling</a>
            </div>
            	<div id="nav_right">
                	<a href="">Google Analytics</a> <br />
                    <a href="">Google Maps</a> <br />
                    <a href="">Mobiel</a> <br />
                    <a href="">Huisstijl ontwikkeling</a> <br />
                    <a href="">Drukwerk</a> <br />
                    <a href="">Vertalingen</a>
                </div>
        <div id="contact_right">
        	 <p>Amstel webdesign <br />
        	 ff<br />
        	 ff<br />
        	 ff<br />
        	 <span>T</span> ff<br />
        	 <span>@</span> ff</p>
   	</div>
             <div id="contact_center">
        	 	 <p>Amstel graphics<br />
        		 ff<br />
        		 ff<br />
   	 	  	  	 ff<br />
        		 <span>T</span> 06 23 45 67 89<br />
        		 <span>@</span> graphics@amstel.nl
                 <br /> <br />
[color=red]                 <?php
                 echo ("Amstel_webdesign_graphics" date ("Y"))
			 ?>[/color]
                 </p>
  		   	 </div>
             	<div id="contact_left">
        	 		 <p>Amstel teksten<br />
        			 ff<br />
        			 Geen idee <br />
   	 	  	  		 ff<br />
        			 <span>T</span> 06 98 76 54 32<br />
        			 <span>@</span> teksten@amstel.nl</p>
  		   	 	</div>
    </div>
</div>
<!-- footer end -->		

 

Here's the footer that goes with the previously posted code. PHP part marked in red.

 

Thanks for the quick reply by the way.

 

Anthony

Link to comment
Share on other sites

and now for why... though as a php noob myself, I may be wrong, however if we don't know why we don't learn owt! :D

 

the '.' acts as a joiner between echo statements and functions without having to discontinue the echo (dunno it that's the correct technical explanation, but that's how I understand it)

 

and you need a ';' at the end of every php command.

 

Hope that helps... maybe not, but hey :) It's not often I get to actually ANSWER questions on here, I'm usually asking them :)

Link to comment
Share on other sites

and now for why... though as a php noob myself, I may be wrong, however if we don't know why we don't learn owt! :D

 

the '.' acts as a joiner between echo statements and functions without having to discontinue the echo (dunno it that's the correct technical explanation, but that's how I understand it)

 

and you need a ';' at the end of every php command.

 

Hope that helps... maybe not, but hey :) It's not often I get to actually ANSWER questions on here, I'm usually asking them :)

 

hahaha, it is very helpful indeed. Thanks so much.

 

Anthony

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.