Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

inserting form object in echo statement in index.template.php

Aloittaja St8, huhtikuu 13, 2008, 06:00:02 IP

« edellinen - seuraava »

St8

Hi

I get the "Template Parse Error!" when I try and insert a form object into the echo statement where my footer is. I have already added the javascript script with the header tags

This is my code snippet that gets the error:

  echo '
</div>
<div id="footer"></div>
<div id="footerbox"/>
<ul id="footer_links">

<li><a href="compare_mobile_phones.html">Mobile Phones</a></li>
<li><a href="news.html">Latest News</a></li>
<li><a href="frequently_asked_questions.html">FAQs</a></li>
<li><a href="forum">Forum</a></li>
</ul>


<form id="subscribeform" method="post" action="/applications/">
<fieldset>
<legend>Email updates</legend>
<label for="email">Email address</label>
<input type="text" name="email" id="email" value=" enter your email" onfocus="clearBox(this, ' enter your email')" onblur="fillBox(this, ' enter your email')" />
<input name="list_id" type="hidden" value="12" />
<input name="emailsubject" type="hidden" value="RecycleNow updates signup notification" />
<input type="image" value="search" src="images/sign_up.gif" />
</fieldset>
</form>

<ul id="tc_links">


<li><a href="/copyright.html">&copy; Copyright</a></li>
<li><a href="/terms.html">T &amp; C</a></li>
<li><a href="/privacy.html">Privacy Policy</a></li>
<li><a href="/contact.html">Contact Us</a></li>
<li><a href="/media.html">Media</a></li>
<li><a href="/about_us.html">About Us</a></li>
<li><a href="/sitemap.html">Site map</a></li>
</ul>
    Projectorphoneshop.com - The next generation of mobile phones </div>
<div class="footer"><p>', theme_copyright(),'</p>
<br />';


This is the same code snippet that doesn't get the error because the form code isn't included

echo '
</div>
<div id="footer"></div>
<div id="footerbox"/>
<ul id="footer_links">

<li><a href="compare_mobile_phones.html">Mobile Phones</a></li>
<li><a href="news.html">Latest News</a></li>
<li><a href="frequently_asked_questions.html">FAQs</a></li>
<li><a href="forum">Forum</a></li>
</ul>

<ul id="tc_links">


<li><a href="/copyright.html">&copy; Copyright</a></li>
<li><a href="/terms.html">T &amp; C</a></li>
<li><a href="/privacy.html">Privacy Policy</a></li>
<li><a href="/contact.html">Contact Us</a></li>
<li><a href="/media.html">Media</a></li>
<li><a href="/about_us.html">About Us</a></li>
<li><a href="/sitemap.html">Site map</a></li>
</ul>
    Projectorphoneshop.com - The next generation of mobile phones </div>
<div class="footer"><p>', theme_copyright(),'</p>
<br />';

// Show the load time?
if ($context['show_load_time'])
echo ''. $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'];


How can I insert this form code that causing the trouble



<form id="subscribeform" method="post" action="/applications/">
<fieldset>
<legend>Email updates</legend>
<label for="email">Email address</label>
<input type="text" name="email" id="email" value=" enter your email" onfocus="clearBox(this, ' enter your email')" onblur="fillBox(this, ' enter your email')" />
<input name="list_id" type="hidden" value="12" />
<input name="emailsubject" type="hidden" value="RecycleNow updates signup notification" />
<input type="image" value="search" src="images/sign_up.gif" />
</fieldset>
</form>


I need it in that place to appear correctly in my footer.

Thank you all. Im normally quite good at trial and error with php as im no coder but this one has caused me a few problems.

Thank for your time<

steven  :D

Eliana Tamerin

It's probably this line:

<input type="text" name="email" id="email" value=" enter your email" onfocus="clearBox(this, ' enter your email')" onblur="fillBox(this, ' enter your email')" />

Try this instead:

<input type="text" name="email" id="email" value=" enter your email" onfocus="clearBox(this, \' enter your email\')" onblur="fillBox(this, \' enter your email\')" />
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

karlbenson

Remember which set of quotes your using to echo, you need to escape natural occurances of those within the string.

eg
echo 'It\'s my birthday';
or
echo "Its's not \"my\" birthday";

St8

Thank you very much karlbenson and Eliana, it is working now :-) Thank you Eliana for giving me the solution and thank you karlbenson for explaining it :-)

Advertisement: