Welcome Guest, Not a member yet? Register   Sign In
error while including another view file
#1

[eluser]Unknown[/eluser]
Quote:Hey guys. I have gotten this error for many days please help.

A PHP Error was encountered

Severity: Warning

Message: require_once(header.php) [function.require-once]: failed to open stream: No such file or directory

Filename: libraries/Loader.php(673) : eval()'d code
here is my code for view_form.php
Line Number:
<tr>
<td><font size:"10" color=red>*</font>Vehicle No:</td>
<td>&lt;input type="text" name="vehicle" id="vehicle" placeholder="Enter vehicle no" size="25" class="php_input"&gt;&lt;/td></tr>
<tr><td>&nbsp;</td></tr>

<tr><td><font size:"10" color=red>*</font>Registration Place:</td>
<td>&lt;input type="text" name="regpl" id="regpl" placeholder="Enter Place or City name" size="25" class="php_input"&gt;&lt;/td>
</tr> <tr><td>&nbsp;</td></tr>
<tr>
<td><font size:"10" color=red>*</font>Registration Place:</td>
<td>&lt;?php include "date.php";?&gt;</td>
</tr>
<tr><td>&nbsp;</td></tr>
#2

[eluser]jotorres1[/eluser]
I would recommend for you to use the CI Load, and not use php include. Use:

Code:
&lt;?php $this->load->view('date'); ?&gt;
#3

[eluser]it.peds[/eluser]
Or it needs the full path, even they are in the same folder.
#4

[eluser]srpurdy[/eluser]
Like Jotorres1 said. you should use CI view() to load other view files.

And ditch the 1998 table code. Smile

<font> isn't used anymore. Use CSS instead. Makes your code much cleaner, also rendering wise tables are slow. They should not be used for layouts. Specially considering you can make things look much nicer with css, and have more control over the layout.

Take a peak at Twitter Bootstrap.
http://twitter.github.com/bootstrap/

It's a really nice base set of CSS. for form fields buttons. pretty much almost anything you would need for a UI. Smile
#5

[eluser]phann123[/eluser]
[quote author="srpurdy" date="1345305175"]Like Jotorres1 said. you should use CI view() to load other view files.

And ditch the 1998 table code. Smile

<font> isn't used anymore. Use CSS instead. Makes your code much cleaner, also rendering wise tables are slow. They should not be used for layouts. Specially considering you can make things look much nicer with css, and have more control over the layout.

Take a peak at Twitter Bootstrap.
http://twitter.github.com/bootstrap/

It's a really nice base set of CSS. for form fields buttons. pretty much almost anything you would need for a UI. Smile[/quote]
thank




Theme © iAndrew 2016 - Forum software by © MyBB