Codeigniter new page problem |
[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
[eluser]Jan_1[/eluser]
Post the text of application/controller/jobs.php, please.
[eluser]e_c_manson[/eluser]
What text is it you require? The actual code or what error message I am getting?
[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 & Time</div> </li> <?php foreach($events_by_date as $row): ?> <li> <div class="contain"> <div class="title"><?=$row->title;?></div> <div class="thumbnail"><?php if($row->img): ?><img src="<?=base_url();?>img/spacer.gif" alt="" /><?php endif; ?></div> <div class="desc"><?php echo nl2br(strip_tags($row->desc)); ?></div> <div class="date"> <?php if($row->one_day_event==1): ?> <?=date("jS F Y", strtotime($row->start_date));?> <?php else: ?> <?=date("jS F Y", strtotime($row->start_date));?> - <?=date("jS F Y", strtotime($row->end_date));?> <?php endif; ?> <?php if($row->inc_time==1): ?> <br /><span ><?=substr($row->start_time, 0, 5);?> - <?=substr($row->end_time, 0, 5);?></span> <?php endif;?> </div> <div class="clear"></div> <?php if($row->img): ?><a rel="lightbox" class="event_main_link">poster_image!=''): ?>href="<?=base_url();?>img/event_images/poster_images/<?=$row->poster_image;?>"<?php else: ?>href="<?=base_url();?>img/event_images/l/<?=$row->img;?>"<?php endif; ?>> </a><?php endif; ?> </div> </li> <?php endforeach; ?> </ul> <?php endif; ?> 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.
[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"
[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?
[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? |
Welcome Guest, Not a member yet? Register Sign In |