I am learning how to use code igniter and following tutorials. As this is my first time to use MVC, I'm having some trouble implementing the send function. I am doing a tutorial on how send a newsletter sign up form.
For some reason when I hit submit with or without the info, its giving me a 404 page not found with the /send extension. Is there something I'm missing in my config file?
Here is the code
Thanks in advance.
Is not send that is failing but you missed something in your config.
http://codeigniter.com/user_guide/general/urls.html
You should set up your .htaccess according to the guide above.
Did you setup the CodeIgniter rewrite rules in your .htaccess?
Apart from the htaccess possible problem, there are a couple of things wrong in the file you posted:
1) the html <title>HEY<title> before the php class, but I hope that's a typo, right? you don't have html in your controller file, right?
2) You're getting the POST variable wrong; or better, you're confusing and mixing things.
Instead of
$this->input->$_POST('name'); //which is also sintactically wrong
should be:
$this->input->post('name').
The input class already does the retrieving of this superglobal. And unsets them in favour of its own.
3) To use an attachment, you need to call
$this->email->attach($filename);
You just declared a variable and nothing else.
4) What is $this->email->set_newline("\r\n"); ?
I don't see this function in the email class...You need to use a config file for this, or pass the value on library's inizialization:
$config['newline'] = "\r\n";
$this->email->initialize($config);
Related
Please, can someone help me out and tell me what is wrong with my CakePHP app registeri controller method code on GitHub? https://github.com/olaolu20077/jobtest.git
I'm having an issue with form submission on it, because I'm not getting redirected to homepage and no flash success message coming up on form submission.
Thank you.
I added flash ->render()?> To my layout and debug ($user75z->get error(); exit; to the upper part of the flash error message in the controller, yet got no solution to the form submission.
Can you try to do dd{$user75z) before saving it? See if you get any errors from it, maybe also consider renaming your variables. This makes the code less messy.
EDIT: I see you also use the same lines of code in almost every controller method, maybe try putting these in the entity or table?
I try to append HTML in js file. It was OK for SPA mode.
But when I change to universal mode, the HTML can't be appended.
Then I try to set the timeout for append function and it's Ok. The HTML is appended successfully.
I don't understand the reason why?
I just a new member in nuxt, so please help me explain the reason why, and how can I append HTML without set timeout?
Thanks so much!
Without seeing the code you are using to try and implement appending html I can't be certain, but I suspect the process where the appending is to happen is taking place on the server, before it is rendered to the client.
To get around this you could implement the use of process.client to delay the appending.
if (process.client) {
//do what needs to be done
}
The other option would be to use the mounted hook to call to append the html.
As I say, if you post the code you are trying to use it would be possible to show a more detailed answer.
I am hosting my Sinatra application using Apache with Passenger. It's hosted within a subfolder -- meaning, my main site is example.com, my application is at example.com/popcorn.
So I have a get '/' route, and that works fine. The problem is that my view includes a HTML form that makes a post request to upload, and the post '/upload' route isn't handling it. Instead of example.com/popcorn/upload, it's trying to get example.com/upload.
So I figure okay, not the ideal solution, but for now I'll hardcode the form action URL. But that doesn't work either -- making the action popcorn/upload fails too. This is where I get a little baffled, and my Google-fu was weak, I couldn't find help there.
Maybe I could have some kind of Apache rewrite rule, but is that the correct solution? Am I missing something? I would really appreciate a tip here because it feels like I've messed up something very simple and it's really bugging me.
You probably want the url helper method. That takes into account where the app is mounted on the server:
url('/upload')
The above code will evaluate to something like this:
http://example.com/popcord/upload
Inside your app you shouldn’t need to change anything, this will be routed to the existing post '/upload' handler.
I using ZendFW 1.7.2 in my project and need to save PDF file. i am success for use function drawText but some of my data is too long so i need it break line. Now i get a solution from
http://devzone.zend.com/1776/creating-pdf-documents-with-zend-framework/
that use function drawTextBlock but when i test with it.It's can't success any always return errors
Fatal error: Call to undefined method Zend_Pdf_Page::drawTextBlock()
I think it's relate problem with something configuration ?Anyone used to success on it? please share it to me, I am looking to see your reply soon.
Thanks
DrawTextBlock is not existing in Zend Framework as it is a proposal for a improvement by Nico Edtinger. See: http://framework.zend.com/wiki/display/ZFPROP/Zend_Pdf+text+drawing+improvements+-+Nico+Edtinger
The solution provided on Zend Framework PDF multiline problems probably will help you further.
Does anyone know a way of redirecting to another webpage from lotus domino web query an open agent? The print statement does not seem to work. A possible workaround would be very appreciated!
Something on that subject can be found here but it seems kind of flaky like this
link.
Can it be done without JavaScript and major redesign of document form?
Thanks in advance.
You do realize that the 4/5 forum is almost a decade out-of-date, right? If you're using a more recent version of Notes/Domino, I'd check the 6/7 forum (or even the 8 if you're on that release, since it's so different); here's the search results for "webqueryopen redirect"; there are a lot more possible answers.
Notes 6/7 forum results
The simplest answers to your actual question are here and here.
Better to wite to 'location:' header directly, as avoids Javascript and meta-tags.
This is from one of the responses on the thread you pointed to and should work fine - have the WQO agent simply write to a hidden field on the form. This will do a client-side redirect, so you'll get two trips to the server.
You could use your WQO to set a field
on the document called redirect. Set
the field to text and hide it from
everything. HEre's what you put in the
field (with your WQO agent):
location.replace('http://www.website.com');
In your HtmlHeadContent, put this
formula:
"" +
#NewLine + redirect + #NewLine +
""
A line of code in WQO agent does the trick, but note it still loads the page before the redirect:
Call s.Documentcontext.Replaceitemvalue("$$HTMLHead", {<meta http-equiv="REFRESH" content="0;url=http://www.etfos.hr">"})
in your agent, simply do the following
print |[| & requiredURL & |]|
Try to see if you really need to open the document instead of running an agent and pass the params in the Query_String
I think that wqo cannot redirect to another page as it will end up redirecting you to the document you either opened or are creating. I may be wrong but yesterday I was trying to either do one thing or the other based on the params I was passing to the OpenCorm url command and it seems that although it is running the agent, the pw.println() command doesn't behave the same as if it was a WQS agent.
If you don't need to open a document, try running an agent and pass the params to it
The proper way to do it is to have one print statement with the URL you want to redirect to in brackets. This will generate a 302 REDIRECT on the server.
Example code:
%REM
Agent redirect
Trigger: On Schedule - Never
Target: None
Security Level: 1
%END REM
Option Public
Option Declare
Sub Initialize
Print "[http://www.ibm.com]"
End Sub
Some people have suggested Meta Refresh. This is discouraged by the W3C. See the following link:
http://en.wikipedia.org/wiki/Meta_refresh#Usability