Jump to content

xlxprophetxlx

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

About xlxprophetxlx

  • Birthday 06/12/1985

Profile Information

  • Gender
    Male
  • Location
    Pennsylvania

xlxprophetxlx's Achievements

Member

Member (2/5)

0

Reputation

  1. userid is defined further up in my coding but in this example it shouldn't matter since $userfinal == "" is true as shown. and it's not outputting echo $useridstring; for some reason.
  2. I can't seem to echo this out of a function: mt_srand ((double) microtime() * 1000000); $useridstring = md5(uniqid(mt_rand())); $userfinal = ""; function useridfun(){ if($userfinal == ""){ echo $useridstring; }elseif($userfinal == $userid){ echo $userfinal; } } useridfun() This is pretty much driving me nuts. I had it working earlier but now it doesn't seem to want to work. If I print or echo $useridstring by itself it works but not within the function. It got to be something I'm just over seeing. Thanks!
  3. Correct. There really is no need for the data to be saved after the browser is closed. I'm just looking for an instance. Adding a lifespan of a day on the cookie would be the longest time period I foresee needed if any. With the multi-dimensional array I was thinking each array would increment by one (i++) with a loop: 0 => Array1, 1 => Array2, 2=>Array3 ect.. Just unsure the exact order to write the loop to allow items to be added.
  4. Instead of involving a database would it be possible to use a multi-dimensional array or just have a cookie that stores the information? This doesn't need to be secure, it just for random users to create a quick grocery list. Like array(array1, array2, array3, array4, ect...) and each array contains the id, category, product_name, note, qty of each custom product added. Possibly have a mini cart that loops through the arrays and shows the product name, qty and a delete next to it. The delete would use unset what ever the that array would be. Under the mini cart would have a view whole cart which would be exactly like the mini cart but with the addition of showing the note. Thanks for the help.
  5. I think your over complicating the code. I would do this for example (use for a basic structure; modify as needed): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <style type="text/css"> html, body{ margin:0; padding:0; } #container{ margin:0 auto; /* Too Center the Div */ width:960px; /* For Example */ } #container div{ float:left; display:inline; width:300px; /* Even Columns while compensating for padding */ padding:10px; } </style> <div id="container"> <div> <!--New Query--> <h1>Category Title</h1> <ul> <li>list item</li> <li>list item</li> <li>list item</li> <li>list item</li> </ul> <!--New Query--> <h1>Category Title</h1> <ul> <li>list item</li> <li>list item</li> <li>list item</li> <li>list item</li> </ul> </div> <div> <!--New Query--> <h1>Category Title</h1> <ul> <li>list item</li> <li>list item</li> <li>list item</li> <li>list item</li> </ul> </div> <div> <!--New Query--> <h1>Category Title</h1> <ul> <li>list item</li> <li>list item</li> <li>list item</li> <li>list item</li> </ul> <!--New Query--> <h1>Category Title</h1> <ul> <li>list item</li> <li>list item</li> <li>list item</li> <li>list item</li> </ul> </div> </div> </body> </html> The problem you are running into is box level elements. You technically only need 3 columns and 1 row if you were going to do a table layout. I would use the above as a reference and swap out as needed.
  6. Hello everyone. Looking for a little help here. I am trying to make a simple grocery list. I got it to print out the full array but I need another item to be added each time I add a new one then the ability to delete/modify the item. Can anyone lead me in the right direction? <?php session_start(); $id = $_POST['id']; $category = $_POST['category']; $product_name = $_POST['product_name']; $note = $_POST['note']; $qty = $_POST['qty']; $_SESSION['id'] = $id; $_SESSION['category'] = $category; $_SESSION['product_name'] = $product_name; $_SESSION['note'] = $note; $_SESSION['qty'] = $qty; function addCustomProductToSession() { if(isset($_POST['id'])){ $custom_items = array($_SESSION['id'], $_SESSION['category'], $_SESSION['product_name'], $_SESSION['note'], $_SESSION['qty']); foreach ($custom_items as $key => $custom_item) { $custom_items[$key] = $custom_item; } print_r($custom_items); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Grocery List</title> <script type="text/javascript"> <!-- function formsubmit(form) { form.action = 'index.php'; return true; } //--> </script> </head> <body> <p>Add Your Custom Product</p> <form action="" method="post" id="cart" onsubmit="formsubmit(this);"> <div><input name="usedb" id="usedb" value="0" type="hidden" /></div> <div><input name="id" id="id" value="<?php echo rand(400, 5000); ?>" type="hidden" /></div> <div><input name="category" id="category" value="18" type="hidden" /></div> <p><input size="15" id="product_name" name="product_name" onfocus="this.value=''" value="Enter Product Name" type="text" /></p> <p><input size="15" id="note" name="note" onfocus="this.value=''" value="Enter Note Here" type="text" /></p> <p><input name="qty" id="qty" maxlength="2" size="1" value="1" type="text" /></p> <p><input type="submit" name="submit" value="submit" /></p> </form> <?php echo "<br /><br /><br />"; addCustomProductToSession(); ?> <p><a href="#" onclick="destroy()">Destroy Session</a></p> </body> </html> Thanks for the help in advance! -Mike
  7. Hello, I am having a little trouble getting some of my code to work. I converted this: http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart ... Working demo doesn't work. To act more like a Shopping List instead of a Shopping Cart. The client would like to the ability for a user to add a custom item then when viewing the shopping list the ability to add a note (simple input field). When the user is done they will be able to print the list out. An example of what I have done is here: http://www.econnectatgmdd.com/shopping_cart/index.php I am currently working on this section: http://www.econnectatgmdd.com/main_shopping_cart/index.php it is somewhat working but I am using $_POST instead of a SESSION which is what I should really be using. Is there any suggestions on what I might be doing wrong? Attached is what I have thus far. It's not pretty at the moment because I am still working on it. Any incite would be appreciated. Thanks, -Mike [attachment deleted by admin]
  8. To elaborate on that further, is there a way to transfer the values from the form to the email then from a link add them to the database?
  9. Hi I have a client that uses the Form Maker Pro software to create forms rather easy. What they need setup is a Double Opt-In process. Right now when someone fills out the form and clicks submit the End-User gets an email saying Thank You and the Admin gets an email notification as well as well as it stores all this information into the database. The action of the form goes to "formprocessorpro.php" Now is there a way to Double Opt-In from the email the End User gets then Puts the information into the database? Any direction would be great. Thanks, -Mike
  10. I currently don't have anything setup for the dev subdomain because it is a testing area for the moment but I am assuming I will need to add something to this to get it to work. Here is the htaccess ## # @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $ # @package Joomla # @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL # Joomla! is Free Software ## ##################################################### # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE # # The line just below this section: 'Options FollowSymLinks' may cause problems # with some server configurations. It is required for use of mod_rewrite, but may already # be set by your server administrator in a way that dissallows changing it in # your .htaccess file. If using it causes your server to error out, comment it out (add # to # beginning of line), reload your site in your browser and test your sef url's. If they work, # it has been set by your server administrator and you do not need it set here. # # Only use one of the two SEF sections that follow. Lines that can be uncommented # (and thus used) have only one #. Lines with two #'s should not be uncommented # In the section that you don't use, all lines should start with # # # For Standard SEF, use the standard SEF section. You can comment out # all of the RewriteCond lines and reduce your server's load if you # don't have directories in your root named 'component' or 'content' # # If you are using a 3rd Party SEF or the Core SEF solution # uncomment all of the lines in the '3rd Party or Core SEF' section # ##################################################### ##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work ##### # SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED # OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING # # In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line: # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## # May need to be uncommented. If you are running your Joomla/Mambo from # a subdirectory the name of the subdirectory will need to be inserted into this # line. For example, if your Joomla/Mambo is in a subdirectory called '/test/', # change this: # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## # to this: # RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes## # ##################################################### ## Can be commented out if causes errors, see notes above. Options +FollowSymLinks # # mod_rewrite in use RewriteEngine On # Uncomment following line if your webserver's URL # is not directly related to physical file paths. # Update Your Joomla/MamboDirectory (just / for root) RewriteBase / ########## Begin - Joomla! core SEF Section ############# Use this section if using ONLY Joomla! core SEF ## ALL (RewriteCond) lines in this section are only required if you actually ## have directories named 'content' or 'component' on your server ## If you do not have directories with these names, comment them out. # #RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## #RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] #RewriteRule ^(content/|component/) index.php # ########## End - Joomla! core SEF Section ########## Begin - 3rd Party SEF Section ############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php # ########## End - 3rd Party SEF Section ########## Begin - Rewrite rules to block out some common exploits ## If you experience problems on your site block out the operations listed below ## This attempts to block the most common type of exploit `attempts` to Joomla! # # Block out any script trying to set a mosConfig value through the URL RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] # Block out any script trying to base64_encode crap to send via URL RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] # Block out any script that includes a <script> tag in URL RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] # Block out any script trying to set a PHP GLOBALS variable via URL RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST variable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) # Send all blocked request to homepage with 403 Forbidden error! RewriteRule ^(.*)$ index.php [F,L] # ########## End - Rewrite rules to block out some common exploits Anyone see anything that I could change or add? When this is all said and done the joomla site is going to be in the www.thoughtdrivers.com/sharing/ folder and a new site will be replacing www.thoughtdrivers.com. So the lines were it rewritecond takes place it will be /sharing/. This may stop the problems since it the htaccess will be in the /sharing/ folder and not the root directory, but I need something for the time being to do testing. Thanks for all the help any input would be great. -Mike
  11. On this page: http://www.thoughtdrivers.com/dev/sharing/index.php It should be useing this code: <?php // Start a session session_start(); if (session_is_registered('loginid') || session_is_registered('username')) { //user is logged in ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Good</title> </head> <body> <?php echo "Logged In"; ?> </body> </html> <?php }else{ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Bad</title> </head> <body> <?php echo "Not Logged In"; ?> </body> </html> <?php } ?> But I am guessing the SEF htaccess is taking over the url and causing the main page to show up. This is what I am guessing which I am to have to search the database for this link and make sure it comes up correctly if this is the problem.
  12. In addition, I thought you should know that the base site www.thoughtdrivers.com is using Joomla 1.013 and everything in the .htaccess files controls SEF URL's .
  13. http://dev.thoughtdrivers.com/ By the way thanks for looking into this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.