Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Don't bump your posts. Post your updated code.
-
Yes.
-
Don't do it as a sub-select, do it as a regular join.
-
How To Remove .php - Why So Many Options?
Jessica replied to justlukeyou's topic in Apache HTTP Server
Since this is the only question you actually asked in your post, I'm going to go with: Because. Computers. -
How To Remove .php - Why So Many Options?
Jessica replied to justlukeyou's topic in Apache HTTP Server
That is in fact about the farthest you could get from an easy solution. -
It's ... Unnecessary ... You know they're tables and its more for you to have to type.
-
You could just do the math in the query.
-
Uhm. I just told you about one.
-
Bootstrap.js has a sticky footer
-
No we will not help you illegally steal someone else's hard work.
-
Google Data Normalizing - you're storing the data wrong.
-
I didn't say anything about any ebooks. This forum is not for copy-paste code, and you can't solve your problem by copy-and-paste. You can solve it with find-and-replace. You don't even need any code. If you want to learn PHP, you won't do it by complaining that you don't know it yet.
-
You could use a constant to store the name. You could use a variable. You could use a function. A constant is probably best. However any decent IDE should be able to replace all the instances you already have with the new name/constant/variable/function.
-
Symfony 2 - processing a form in one action, display in another
Jessica posted a topic in Frameworks
I may be going about this all wrong, so feel free to tell me This is my first attempt at using Symfony. I have a controller which generates a form in one action (My "view all" page, it displays both the list of existing and the form to create) and the form processing is in another action ("add action"). In the add action I process the form and add if it's valid. Whether or not it's valid you get redirected back to the view all page to see the form again. I want the processing to be a different action/route in order to prevent submitting again upon refresh, and I just prefer the processing in a different action. The problem is when there is an error, the form doesn't display it, because after redirecting back to the view all action, the form's data is gone. How do I persist the errors/values/etc over multiple actions? I can't find any examples of this in Symfony, it looks like they always do the processing in the same action. I thought first to put the form in the session, but I don't want to store a ton of form objects manually if there's a better way to do this. public function viewAllAction() { $repository = $this->getDoctrine()->getRepository('SageCoreBundle:Service'); $services = $repository->findBy(array('active' => 1)); $this->form = $this->createForm(new ServiceType, null); return $this->render('SageAdminBundle:Service:viewAll.html.twig', array( 'services' => $services, 'form' => $this->form->createView() ) ); } public function addAction(Request $request) { $this->form = $this->createForm(new ServiceType, null); if ($request->isMethod('POST')) { $form->bind($request); if ($form->isValid()) { $service = $form->getData(); $service->setActive(1); $em = $this->getDoctrine()->getManager(); $em->persist($service); $em->flush(); $this->get('session')->getFlashBag()->add('success', 'Service Added!'); return $this->redirect($this->generateUrl('admin_services')); } else { $this->get('session')->getFlashBag()->add('error', 'Error'); return $this->redirect($this->generateUrl('admin_services')); } } } -
No, your code should prevent them from doing that.
-
Question about returning true and false values
Jessica replied to eldan88's topic in PHP Coding Help
returning false is not the same as not returning anything. Because PHP is loosely typed you can get similar effects but you can also get very different effects. It depends on what you're doing with the result of the function. http://us3.php.net/manual/en/language.types.type-juggling.php http://us3.php.net/manual/en/types.comparisons.php -
query only returns the last row from database
Jessica replied to calmchess's topic in PHP Coding Help
Because you're only echoing it once, after everything is done. You have two loops, you only need one, and you should echo within the loop. -
I have never written a tutorial about PHP Mailer, probably because I've never even used it. You don't have to supply anything like mail.domain.com.
-
I'm not a he.
-
So, no. OP: Post your updated code so we can see what you did.
-
if(mail ($email, $emailsubject, $body, "From: $fromname <$fromemail>")) is the line that sends the mail. "mailer" doesn't mean anything.
-
It's already an array, so just pick the keys you want and concatenate them into a string.
-
Session variables not carried onto subsequent pages
Jessica replied to babymac's topic in PHP Coding Help
Use || instead of or -
Session variables not carried onto subsequent pages
Jessica replied to babymac's topic in PHP Coding Help
Is <p> HTML or PHP? Look at what's different between the code that works.