Search found 2780 matches

by social_experiment
Thu Oct 08, 2015 4:09 am
Forum: PHP - Code
Topic: Rewrite rule causing navigation issues
Replies: 1
Views: 1785

Rewrite rule causing navigation issues

I have this rewrite rule [text] RewriteRule ^console/sales_view/([0-9]+)$ console/sales_view.php?s=$1 [/text] It works for the innitial page (of pagination) but once I navigate to the next page, the content is still displayed, but without styling and the url looks like this [text] http://localhost/c...
by social_experiment
Wed Sep 09, 2015 3:13 pm
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

Christopher wrote:Why do you need an exception?
currently it helps with debugging but should something happen during the query process i'd like the application to degrade as gracefully as possible - replace the error message with something more user friendly and email the error message to an administrator
by social_experiment
Wed Sep 09, 2015 12:05 am
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

this would be on the index page
by social_experiment
Tue Sep 08, 2015 6:42 am
Forum: PHP - Code
Topic: Contact Form details not shown in email
Replies: 3
Views: 1119

Re: Contact Form details not shown in email

are you receiving an error message?
by social_experiment
Tue Sep 08, 2015 3:48 am
Forum: PHP - Code
Topic: Contact Form details not shown in email
Replies: 3
Views: 1119

Re: Contact Form details not shown in email

[text] <input type="text" class="input-block-level" required="required" placeholder="Your First Name" value=""> // <input type="text" name="first_name" class="input-block-level" > [/text] You need a name attribute in you...
by social_experiment
Tue Sep 08, 2015 12:16 am
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

Christopher wrote:It seem like the index page that uses the data should get the $prodObj object.
something to this effect:

Code: Select all

<?php
 // index page
 include_once 'controller.php';

 try {
  $data = $prodObj->getRandomProducts();
 }
 catch (Exception $e) {
   // display custom error
 } 
?>
by social_experiment
Mon Sep 07, 2015 3:10 am
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

The question I would ask is: what is the exception communicating? Is it that some actual error occurred? The exception is to display an error, a database error in this case. In the latest version of the code I've done the following: - Moved the try / catch block into the class - the 'controller' pa...
by social_experiment
Sun Sep 06, 2015 12:16 pm
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

Generally , exceptions should be cached through the top level component of an application. The top of these three would be the class; is your suggestion to catch the exception within the class? that maybe you are calling things in the wrong place. It would be better to catch the exception within ge...
by social_experiment
Wed Sep 02, 2015 10:23 pm
Forum: PHP - Code
Topic: im getting a 0 value when i need a correct order ID
Replies: 6
Views: 1338

Re: im getting a 0 value when i need a correct order ID

<?php // Check if an order already exists $query = "SELECT payment_id FROM host_payments2014 WHERE payment_userid = %s AND id = %s AND payment_transaction_status = %s AND payment_amount_due = %s AND payment_type = %s AND year = %s LIMIT 1"; ?> what are the results when you echo the query ...
by social_experiment
Wed Sep 02, 2015 7:23 am
Forum: PHP - Code
Topic: pagination header for dynamic website
Replies: 1
Views: 970

Re: pagination header for dynamic website

I'll explain assuming that you are retrieving records from a database and want to paginate those; you have to page along the amount of elements per page and the starting point for the next set of records. The url might look like this: www.example.com?s=5&ipp=5 (s is the starting point from where...
by social_experiment
Wed Sep 02, 2015 7:16 am
Forum: PHP - Code
Topic: im getting a 0 value when i need a correct order ID
Replies: 6
Views: 1338

Re: im getting a 0 value when i need a correct order ID

<?php $query = "SELECT payment_id FROM host_payments2014 WHERE payment_userid = %s AND id = %s AND payment_transaction_status = %s AND payment_amount_due = %s AND payment_type = %s AND year = %s LIMIT 1"; ?> It seems that the payment records will have some type of unique value for each re...
by social_experiment
Wed Sep 02, 2015 3:12 am
Forum: PHP - Code
Topic: smtp email varification
Replies: 4
Views: 1022

Re: smtp email varification

<?php try { $validator = new SMTP_Validate_Email($email, $from); $smtp_results = $validator->validate(); var_dump($smtp_results); } catch (Exception $e) { echo $e->getMessage(); } ?> returns this: [text] array(2) { ["someone@somewhere.net"]=> bool(false) ["domains"]=> array(1) {...
by social_experiment
Tue Sep 01, 2015 10:56 pm
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Re: Catching an exception in MVC type structure.

It's the public function inside the class that calls a protected function
by social_experiment
Tue Sep 01, 2015 7:29 am
Forum: PHP - Theory and Design
Topic: Catching an exception in MVC type structure.
Replies: 13
Views: 42428

Catching an exception in MVC type structure.

I have the following pages: 1. Class page 2. 'Controller' page 3. index page On the controller page, I have the following code <?php // included class page, created object try { $data = $prodObj->getRandomProducts(); if ($data !== FALSE) { $productArray = $data; } else { // no data in array, 0 recor...
by social_experiment
Tue Sep 01, 2015 7:10 am
Forum: PHP - Code
Topic: smtp email varification
Replies: 4
Views: 1022

Re: smtp email varification

Code: Select all

<?php
var_dump($smtp_results);
?>
what is returned from this