Video Tutorial # 2 -- ERROR in creating database entries - leads me back to wwww directory |
[eluser]JPrieto[/eluser]
hello again, finally were able to duplicate tutorial in video #1 (thanks for all your help) now i'm trying to duplicate tutorial video #2 I copied the Blog controller as in the screen blog_view.php also was coded as in the screen all typos in both files fully checked and.... I edited this line in the config/routes.php $route['default_controller'] = "blog"; it was originally set to "welcome" instead of "blog" im testing it in my local pc wampserver (mysql/php/myPHPadmin bundle) remember, video #1 was duplicated fine, so this is not a server issue HERE IS MY PROBLEM: When I browse to http://localhost/codeigniter/index.php/blog/scaffolding it connects to the database fine but.... when I click on "Create New Record" it takes me to the wwwroot of my server i have codeigniter in a sub-directory of my root wwww directory i would be grateful if anyone can provide tips on how i may fix this issue. thanks
[eluser]Dam1an[/eluser]
<off topic>GRR CAPS LOCK AGAIN </off topic> (Yes, I intentioanlly done that in caps When you hover over the link, does it show the link in the status bar as you'd expect? aka taking you to the correct page and then redirecting for some reason/htaccess issue Or does the URL point to the web root? aka problem with the anchor generated in the view btw, scaffolding is now deprecated anyway
[eluser]JPrieto[/eluser]
lol -- i know those CAPS (just kidding) Anyway, when i hover over the link, the status bar shows http://localhost/codeigniter/index.php/b...olding/add same url but with a "/add" at he end ps: btw, if I take out the indie.php in the url, I get a url not found but that is another issue that i am still wrestling with, and dont want to confuse this thread
[eluser]JPrieto[/eluser]
[quote author="Dam1an" date="1243565073"]btw, scaffolding is now deprecated anyway[/quote] just a thought it would be nice if the tutorial videos could get updated it has really been a great help but some bits of prices are outdated, it seems I'll pray on this
[eluser]JPrieto[/eluser]
[quote author="JPrieto" date="1243565359"] Anyway, when i hover over the link, the status bar shows http://localhost/codeigniter/index.php/b...olding/add same url but with a "/add" at he end [/quote] this is in my pc wampserver being a windows installation maybe is not a .htaccess issue --- but i'm not knowledgeable on this wow, why would it directs me back to my server root when i try to make database entries? i ran out of ideas
[eluser]Dam1an[/eluser]
The video tutorials have been discussed numerous times, some users have made their own, you should be able to find them if you Google
[eluser]JPrieto[/eluser]
okay, i will meantime, do you --or anyone else -- can give me any tips of why i get redirected to the server's root? when i hover over the link (Create New Entry), the status bar shows http://localhost/codeigniter/index.php/b...olding/add same url but with a “/add” at he end please - thanks
[eluser]SpooF[/eluser]
Could you post your blog controller, your routes file and your .htaccess if you have one.
[eluser]JPrieto[/eluser]
hey, hi -- sure, here it is: ======================== blog controller ======================== <?php Class Blog extends Controller { function Blog() { parent::Controller(); $this->load->scaffolding('entries'); } function index() { $data['title']="My Blog Title"; $data['heading']="MyBlog Heading"; $this->load->view('blog_view.php',$data); } ?> =============================== routes =============================== <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* | ------------------------------------------------------------------------- | URI ROUTING | ------------------------------------------------------------------------- | This file lets you re-map URI requests to specific controller functions. | | Typically there is a one-to-one relationship between a URL string | and its corresponding controller class/method. The segments in a | URL normally follow this pattern: | | example.com/class/method/id/ | | In some instances, however, you may want to remap this relationship | so that a different class/function is called than the one | corresponding to the URL. | | Please see the user guide for complete details: | | http://ellislab.com/codeigniter/user-gui...uting.html | | ------------------------------------------------------------------------- | RESERVED ROUTES | ------------------------------------------------------------------------- | | There are two reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded. | | $route['scaffolding_trigger'] = 'scaffolding'; | | This route lets you set a "secret" word that will trigger the | scaffolding feature for added security. Note: Scaffolding must be | enabled in the controller in which you intend to use it. The reserved | routes must come before any wildcard or regular expression routes. | */ $route['default_controller'] = "blog"; $route['scaffolding_trigger'] = "scaffolding"; /* End of file routes.php */ /* Location: ./system/application/config/routes.php */ ========================= no .htaccess file in my pc =============================
[eluser]SpooF[/eluser]
My only guess is that in your config.php file you dont have your $config['base_url'] set correctly. In your instance it should be set to http://localhost/codeigniter/ |
Welcome Guest, Not a member yet? Register Sign In |