Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 9th, 2008, 10:35 PM
Mo
Guest
 
Posts: n/a
Default Include file error (novice).

I have a form which I use to get a date range for reports. I am
beginning to build many more reports than initially thought, and I use
this form in each one. I expect to manage/improve the form, so I want
to just include it from it's own file.
I want to break out of PHP for my form area (instead of having to deal
with a whole bunch of print/echo statements and the added debugging
layer), but am getting an error.

ERROR:
Parse error: syntax error, unexpected $end in /home/voyager1/
public_html/turbine/dateRange_form.inc on line 17

How do I remedy the error?

Here are the ENTIRE contents of dateRange_form.inc:
?>
<form name="dateRange" method="GET" >
<table>
<tr>
<td align="center" class="">From date:
<input name='fromDate' value='<?=date("Y-m-
d",mktime(0,0,0,date("m")-1,1,date("Y")));?>' size=15>
</td>
<td align="center" class="">To date:
<input name='toDate' value='<?=date("Y-m-
t",mktime(0,0,0,date("m")-1,1,date("Y")));?>' size=15>
</td>
<td align="center">
<input type='submit' value='Search'>
</td>
</tr>
</table>
</form>
<?PHP
  #2  
Old October 9th, 2008, 11:15 PM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Include file error (novice).

Message-ID:
<74d6d4a2-caa1-4d25-9e20-c5b7ad76abb7@p10g2000prf.googlegroups.comfrom
Mo contained the following:
Quote:
>ERROR:
>Parse error: syntax error, unexpected $end in /home/voyager1/
>public_html/turbine/dateRange_form.inc on line 17
>
>How do I remedy the error?
Works fine for me. You probably don't have short tags enabled (short
tags are not generally regarded as a good idea anyway)

Try replacing '<?= ' with '<?php echo '


--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
  #3  
Old October 9th, 2008, 11:25 PM
Mo
Guest
 
Posts: n/a
Default Re: Include file error (novice).

On Oct 9, 3:11*pm, Geoff Berrow <blthe...@ckdog.co.ukwrote:
Quote:
Message-ID:
<74d6d4a2-caa1-4d25-9e20-c5b7ad76a...@p10g2000prf.googlegroups.comfrom
Mo contained the following:
>
Quote:
ERROR:
Parse error: syntax error, unexpected $end in /home/voyager1/
public_html/turbine/dateRange_form.inc on line 17
>
Quote:
How do I remedy the error?
>
Works fine for me. You probably don't have short tags enabled (short
tags are not generally regarded as a good idea anyway)
>
Try replacing '<?= ' with '<?php echo '
>
--
Geoff Berrow *0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011http://slipperyhill.co.uk-http://4theweb.co.uk
Hmm.
I'm glad it works (for you at least), but am still stymied.

Short tags are enabled, and the code works as-is when inline, but get
the error when used via include.
The error references line 17. That it the last line. The one which re-
opens PHP.

Any further ideas?

~ Mo
  #4  
Old October 9th, 2008, 11:55 PM
FutureShock
Guest
 
Posts: n/a
Default Re: Include file error (novice).

Mo wrote:
Quote:
On Oct 9, 3:11 pm, Geoff Berrow <blthe...@ckdog.co.ukwrote:
Quote:
>Message-ID:
><74d6d4a2-caa1-4d25-9e20-c5b7ad76a...@p10g2000prf.googlegroups.comfrom
>Mo contained the following:
>>
Quote:
>>ERROR:
>>Parse error: syntax error, unexpected $end in /home/voyager1/
>>public_html/turbine/dateRange_form.inc on line 17
>>How do I remedy the error?
>Works fine for me. You probably don't have short tags enabled (short
>tags are not generally regarded as a good idea anyway)
>>
>Try replacing '<?= ' with '<?php echo '
>>
>--
>Geoff Berrow 0110001001101100010000000110
>001101101011011001000110111101100111001011
>100110001101101111001011100111010101101011http://slipperyhill.co.uk-http://4theweb.co.uk
>
Hmm.
I'm glad it works (for you at least), but am still stymied.
>
Short tags are enabled, and the code works as-is when inline, but get
the error when used via include.
The error references line 17. That it the last line. The one which re-
opens PHP.
>
Any further ideas?
>
~ Mo
Yeah leave out the ?in the beginning and <?php at the end

Scotty
  #5  
Old October 10th, 2008, 12:05 AM
Mo
Guest
 
Posts: n/a
Default Re: Include file error (novice).

On Oct 9, 3:49*pm, FutureShock <futuresho...@att.netwrote:
Quote:
Mo wrote:
Quote:
On Oct 9, 3:11 pm, Geoff Berrow <blthe...@ckdog.co.ukwrote:
Quote:
Message-ID:
<74d6d4a2-caa1-4d25-9e20-c5b7ad76a...@p10g2000prf.googlegroups.comfrom
Mo contained the following:
>
Quote:
Quote:
>ERROR:
>Parse error: syntax error, unexpected $end in /home/voyager1/
>public_html/turbine/dateRange_form.inc on line 17
>How do I remedy the error?
Works fine for me. You probably don't have short tags enabled (short
tags are not generally regarded as a good idea anyway)
>
Quote:
Quote:
Try replacing '<?= ' with '<?php echo '
>
Quote:
Quote:
--
Geoff Berrow *0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011http://slipperyhill.co.uk-http://4theweb.co.uk
>
Quote:
Hmm.
I'm glad it works (for you at least), but am still stymied.
>
Quote:
Short tags are enabled, and the code works as-is when inline, but get
the error when used via include.
The error references line 17. That it the last line. The one which re-
opens PHP.
>
Quote:
Any further ideas?
>
Quote:
~ Mo
>
Yeah leave out the ?in the beginning and <?php at the end
>
Scotty
Since my include is, naturally, withhin a PHP block, I presumed that
it would expect PHP, and that close and open tags would be required if
I was including HTML.

Thanks-a-bunch.
Your solution SIMPLY WORKS ... but why?
Why aren't echo/print statements needed?

~ Mo
  #6  
Old October 10th, 2008, 12:25 AM
Michael Fesser
Guest
 
Posts: n/a
Default Re: Include file error (novice).

..oO(Mo)
Quote:
>Since my include is, naturally, withhin a PHP block, I presumed that
>it would expect PHP, and that close and open tags would be required if
>I was including HTML.
When including a file, PHP jumps back into HTML mode. You always have to
use <?php ... ?tags in an include file around your PHP code. This is
described in the manual.

Micha
  #7  
Old October 10th, 2008, 12:35 AM
Mo
Guest
 
Posts: n/a
Default Re: Include file error (novice).

On Oct 9, 4:19*pm, Michael Fesser <neti...@gmx.dewrote:
Quote:
.oO(Mo)
>
Quote:
Since my include is, naturally, withhin a PHP block, I presumed that
it would expect PHP, and that close and open tags would be required if
I was including HTML.
>
When including a file, PHP jumps back into HTML mode. You always have to
use <?php ... ?tags in an include file around your PHP code. This is
described in the manual.
>
Micha
Ah, there it is.
I've found it now where it specifies that in the manual.

Thanks to all.

~ Mo
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles