Welcome Guest, Not a member yet? Register   Sign In
Codeigniter new page problem
#1

[eluser]e_c_manson[/eluser]
Hello,

I am brand new to Codeigniter and Expression engine and have probably what is a simple problem but one I can’t figure out. I’m having to create a brand new page for the site called rockbarbelfast.com. Pretty much it’s a jobs page with the same layout as the events page. However whenever I create a page jobs.php and upload to the server it won’t display. I have no idea what I’m doing wrong or what I have to do to get it to display in browser.

Any help would be much appreciated.

Thanks

Edward
#2

[eluser]Jan_1[/eluser]
Post the text of application/controller/jobs.php, please.
#3

[eluser]e_c_manson[/eluser]
What text is it you require? The actual code or what error message I am getting?
#4

[eluser]Jan_1[/eluser]
at best both...
#5

[eluser]e_c_manson[/eluser]
I'm getting a basic 404 error message. The code itself is:

<?php if($events_by_date): ?>
<ul id="events_list">
<li class="heading">
<div class="title">Event Name</div>
<div class="thumbnail">Image</div>
<div class="desc">Description</div>
<div class="date">Date &amp; Time</div>
</li>
&lt;?php foreach($events_by_date as $row): ?&gt;
<li>
<div class="contain">
<div class="title">&lt;?=$row->title;?&gt;</div>
<div class="thumbnail">&lt;?php if($row->img): ?&gt;<img src="&lt;?=base_url();?&gt;img/spacer.gif" alt="" />&lt;?php endif; ?&gt;</div>
<div class="desc">&lt;?php echo nl2br(strip_tags($row->desc)); ?&gt;</div>
<div class="date">
&lt;?php if($row->one_day_event==1): ?&gt;
&lt;?=date("jS F Y", strtotime($row->start_date));?&gt;
&lt;?php else: ?&gt;
&lt;?=date("jS F Y", strtotime($row->start_date));?&gt; - &lt;?=date("jS F Y", strtotime($row->end_date));?&gt;
&lt;?php endif; ?&gt;

&lt;?php if($row->inc_time==1): ?&gt;
<br /><span >&lt;?=substr($row->start_time, 0, 5);?&gt; - &lt;?=substr($row->end_time, 0, 5);?&gt;</span>
&lt;?php endif;?&gt;
</div>
<div class="clear"></div>
&lt;?php if($row->img): ?&gt;<a rel="lightbox" class="event_main_link">poster_image!=''): ?&gt;href="&lt;?=base_url();?&gt;img/event_images/poster_images/&lt;?=$row-&gt;poster_image;?&gt;"&lt;?php else: ?&gt;href="&lt;?=base_url();?&gt;img/event_images/l/&lt;?=$row-&gt;img;?&gt;"&lt;?php endif; ?&gt;>&nbsp;</a>&lt;?php endif; ?&gt;
</div>
</li>
&lt;?php endforeach; ?&gt;
</ul>
&lt;?php endif; ?&gt;

I'm basically copying the events page from the website where the client will be able to upload new jobs. I did not build this site but have been asked to add in this new page.
#6

[eluser]Jan_1[/eluser]
So that's your view-file, correct? Show us your controller-file from application/controllers. That's where your problem seem to start.

If you are getting a 404 error when you try to visit a web page, it means that the page does not exist or that it is unavailable. Your Codeigniter Router is looking for a controller-file "jobs.php" if you point your browser to the url "http://mydomain.xy/index.php/jobs"
#7

[eluser]e_c_manson[/eluser]
I've added in a new controller file name job.php and changed everything called 'events' to 'jobs' and I now get database error:

Error Number: 1146

Table 'rockbar.jobs' doesn't exist

(which can be seen here - http://rockbarbelfast.com/jobs)

Does a new table therefore have to be created? and if so where?
#8

[eluser]Jan_1[/eluser]
It's looking in your database 'rockbar' for a table named 'jobs'.

If you don't have one you might create it (with phpMyAdmin or alike). Where did you want to get your data from? Or does the table have a different name in the database? Or do you use a third party script and forget to upload the .sql-file to your MySQL-Server?




Theme © iAndrew 2016 - Forum software by © MyBB