how to make about us file in codeigniter - codeigniter-url

hi I am new in codeigniter. I have welcome.php file. so please tell me that how I can create more files like about us.
I created about_us.php in views and aboutus.php in application/controllers/aboutus.php
I am accessing file with this url localhost/restaurent_templatescodeg/index.php/about_us
but 404 Page Not Found message display.
Please help

Copy welcome.php to about_us.php and change the name of the class to About_Us. Make a view (just php and/or html output) in the views folder and load it via the controller.

Related

How to access html file inside iframe in production

I am creating a web app where, this app will generate a .html file in public/ directory. And after that i want to show that generated html file on a page using iframe .
I am using NextJS for this task. I have configured next.config.js for rewrites but getting 404 error. I am using Railway for hosting. Since in Vercel we can not access filesystem here.
Instead of generating html dynamically, if I upload that .html file, then i can access that file using iframe in production.
I think we can not access those files which were not available during build process. (this is my guess , maybe wrong)
How can I solve this problem or should I use another framework ?
Thanks
Since I was accessing .html files (i.e <iframe src="path-to-file"></iframe>) which were not available during build process, that's why i was getting 404 error.
So I did the following thing:
suppose I want to do this <iframe src="/pdf/page01.xhtml"></iframe> where file location is in public/pdf/page01.xhtml.
so this src is sending a GET request to localhost:3000/pdf/page01.xhtml.
To manipulate this request I created a pages/api/pdf/[...slug].js. In this file you can use process.cwd() to access the file inside your public dir. You read file content using fs.readFile and send the response res.status(200).send(data) like this.
By doing this I was getting the desired result.
Suggestions are always welcome.

Admin page webmatrix i already have a *.cshtml file in root folder?

I am unable to see _admin page in Web Matrix. i already contain a *.cshtml file in root. Also my nuget package manager keeps on uninstalling itself please help me i am new with all this.
If you name a file with an underscore like _admin.cshtml, you will not be able to access it directly. You will however be able to navigate to it if you name it admin.cshtml.
Usually you will want to use underscores on the name when working with things like RenderPage or Layout pages: _Layout.cshtml.
This article has some helpful information on using Layout pages:
http://msdn.microsoft.com/en-us/magazine/gg983489.aspx

Wordpress File Upload Hook

I am trying to hook into the Wordpress file uploader and would like some suggestions. I would like to be able to grab the path of the source file (not WP path; i.e. K:\docs\file.pdf) so I can download another file of the same name (different extension) & path automatically (i.e. K:\docs\file.txt).
Wordpress provides hooks for after the file is uploaded but all path information at that point is internal to wordpress.
Thanks in advance!!
the path information can be obtained from normal php functions like pathinfo() and realpath() for example .
Bit too late to the party but I think what you are asking for is to find the source of the document in the clients system and based on that you want similar files there to be picked up by the browser and then sent to the user.
I think it will be a fairly complex thing to do, firstly you have to get the source of the document being added to the browser (I am not sure it can be done, but if it can be done then it will be via javascript) and then upload all the files one by one to the server hosting wordpress and you can do this by creating a custom page which will add the files uploaded to it as a wordpress attachment and then using something like jquery file uploader to upload files to that location.
But honestly, I think it would be a very complex thing, unless the client and the server are on the same machine.

How can I upload pictures in ASP.NET MVC 3

I want to create a page where I can upload pictures and at the same time bring them to the page.
for example: I have a picture controller which has Index, addpictures in View.
Could anyone please help me?
I am a beginner, so it would be great if you'd write as simple as possible.
Thanks in advance.
You may take a look at the following blog post for a tutorial about uploading files in ASP.NET MVC.
The Path class is defined in the System.IO namespace so you will have to bring that into scope.
If you want to be able to show the uploaded file you will have to store it in some other folder than the App_Data. Files are not directly accessible by clients from this folder. You could for example use the Content folder instead. Once you get the file appear in this folder on the server you could reference it from the view using the <img> tag: <img src="#Url.Content("~/content/someimage.jpg")" /> where you could pass the name of the file to the view from the upload action.

How do I download an msi file via an asp.net button?

So, I've created my wonderful winforms app that I want to unleash upon the world, and now I am trying to create a simple website to host some basic information and link to the setup file (msi installer file )....
I have a button on the asp.net page and the setup file setupApp.msi in same folder as the asp.net page. I am currently trying the following:
Response.Redirect("http://./SetupApp.msi");
But this best guess at what to do is not working. Is there something wrong with Mime types here? What do I need to put in the click event to allow users to download this file?
The path you are passing in to the method is not valid (there's no server name called ".").
You can pass in a relative path and it should work fine because ASP.NET will resolve the path:
Response.Redirect("SetupApp.msi")
Or if it's not in the same folder, try one of these:
Response.Redirect("../Downloads/SetupApp.msi")
Response.Redirect("~/SomeFolder/SetupApp.msi")
Keep in mind that you don't necessarily have to do the whole redirect at all. Instead of writing code in an ASPX file you could just have a link to your MSI:
Download my app!

Resources