Jump to content
Larry Ullman's Book Forums

bshirey44

Members
  • Posts

    9
  • Joined

  • Last visited

bshirey44's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Also I wanted to add that it makes sense to add a 301 redirect in your htaccess file to the full url www.domain.com. That way if someone would type in domain.com or http://domain.com they end up at the full www url. I found that this also fixed an issue i was having with the cookie session being properly maintained as the site is navigated.
  2. I think I found the correct solution. I added the following line to the config in the includes so that it gets used by all pages, both http and https. session_set_cookie_params(0, '/', '.yourdomain', true, false); Now the session is properly getting passed to and from all pages.
  3. OK so i've gotten it to work by passing the session id to the https billing.php page through the url and retrieving it via get. But is this a security risk?
  4. It seems to have something to do with the post variables getting wiped out once the https request is made. Could this be because of my ssl certificate is bad?
  5. Hello Everyone, I am suddenly experiencing an issue with the billing.php script. Once the checkout form is validated it redirects to billing.php. The problem seems to be that once billing.php starts the session, it is getting a different session_id and then gets out at the top and ends up at the empty cart screen because it has lost the previous session values thus preventing the checkout process from completing. I am stumped as to how this is happening. Here is the code from the top of billing.php where it gets out: // Require the configuration before any PHP code: require ('./includes/config.inc.php'); // Start the session: session_start(); // The session ID is the users cart ID: $uid = session_id(); // Check that this is valid: if (!isset($_SESSION['customer_id'])) { // Redirect the user. $location = 'https://' . BASE_URL . 'checkout.php'; header("Location: $location"); exit(); } it is not finding the $_SESSION['customer_id'] which is being set correctly in checkout.php but is being whiped out somehow. Any help is much appreciated. Thanks.
  6. Does anyone have experience with bluehost? It was recommended to me by a friend and they seem to have it all.
  7. <?php // This function will take $_SERVER['REQUEST_URI'] and build a breadcrumb based on the users current path function breadcrumbs($separator = ' » ', $home = 'Home') { // This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))); // This will build our "base URL" ... Also accounts for HTTPS $base = 'http' . '://' . $_SERVER['HTTP_HOST'] . '/'; // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL) $breadcrumbs = Array("<a href=\"$base\">$home</a>"); // Find out the index for the last value in our path array $keys = array_keys($path); $last = end($keys); // Build the rest of the breadcrumbs foreach ($path AS $x => $crumb) { // Our "title" is the text that will be displayed (strip out .php and turn '_' into a space) $title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb)); // If we are not on the last index, then display an <a> tag if ($x != $last) $breadcrumbs[] = "<a href=\"$base$crumb\">$title</a>"; // Otherwise, just display the title (minus) else $breadcrumbs[] = $title; } // Build our temporary array (pieces of bread) into one big string return implode($separator, $breadcrumbs); }
  8. Larry once I get back to my office I'll post the php function I've been trying to modify and maybe you can point me in the right direction. It doesn't quite work because of how you hide the file names from the url. It's probaby an easy fix but I've been spinning my wheels. Thanks.
  9. I was attempting to add a crumb trail to my site that is being modeled after the second example from the book. I am new to web development and php. I found lots of examples of php crumb trails on google, but they don't quite work well with this site. I was wondering if anyone has added this functionality to a site based on the second example and if so would you mind sharing? Thanks.
×
×
  • Create New...