sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
You might take a look at this: http://www.webmasterworld.com/forum88/3146.htm and a lot of other searches on Google
-
I have only used Kohana and CodeIgniter. From my experience, CodeIgniter seems faster to learn, and performance-wise it seems faster as well. CodeIgniter also has really great documentation and an active community. One thing though... CodeIgniter 2.0 is about to come out, so you might want to adopt it as your framework when it does come out. That doesn't mean that you can't start playing with CodeIgniter though.
-
Is the data/content behind the login sensitive or include personal information? If so, the yes. Also, if you are selling things and checking people out with credit card information, your login must be secure to pass a PCI compliance scan.
-
You should also be validating all form input during account creation, the checkout process, or anytime a form is submitted. For instance, for a field that is supposed to be completely alpha characters, you should be checking that there aren't numbers, punctuation, etc.
-
You might need to use the curl cookie jar. Try turning on the header and seeing if the script is trying to set a cookie for the auth. Just a guess...
-
You might try going to some of the popular php framework sites, check to see if they have an authentication library, and then implement it per their user manual. That would be the easiest thing for you. Kohana has an auth library, and I'm sure a bunch of other ones do to. Actually, this is a good question for the frameworks forum.
-
Thorpe, thanks. I should have read what you said and applied it to the code, because that was all it needed.
-
This actually works, as I can echo $path, but if I try to return $path it is empty: <?php $all_categories_array = array( '0' => array( 'category_id' => '1', 'category_name' => 'Examples', 'parent_id' => '0' ), '1' => array( 'category_id' => '2', 'category_name' => 'Widgets', 'parent_id' => '1' ), '2' => array( 'category_id' => '3', 'category_name' => 'Little', 'parent_id' => '1' ), '3' => array( 'category_id' => '4', 'category_name' => 'Hardcore', 'parent_id' => '2' ), ); function get_product_parents($id, $all_categories_array, $steps) { // check the entire categories array for a matching category foreach($all_categories_array as $x => $y) { // if this is the product's category if($y['category_id'] == $id) { // add the category name to the steps array $steps[] = $y['category_name']; // and do recursion if not a top level category if($y['parent_id'] !== '0') { get_product_parents($y['parent_id'], $all_categories_array, $steps ); exit; } else { $reverse_array = array_reverse($steps); $path = ''; foreach($reverse_array as $category_name) { $path .= '/' . $category_name; } // Should be /Examples/Widgets/Hardcore echo $path; } } } } $steps = array(); $whatever = get_product_parents('4', $all_categories_array, $steps); var_dump($whatever);
-
Just getting tired, and don't see my problem. Output should be: /Examples/Widgets/Hardcore but all I am getting is: /Hardcore Code Example: <?php $all_categories_array = array( '0' => array( 'category_id' => '1', 'category_name' => 'Examples', 'parent_id' => '0' ), '1' => array( 'category_id' => '2', 'category_name' => 'Widgets', 'parent_id' => '1' ), '2' => array( 'category_id' => '3', 'category_name' => 'Little', 'parent_id' => '1' ), '3' => array( 'category_id' => '4', 'category_name' => 'Hardcore', 'parent_id' => '2' ), ); function get_product_parents($id, $all_categories_array, $steps) { foreach($all_categories_array as $x => $y) { // if this is the product's category if($y['category_id'] == $id) { // add the category name to the steps array $steps[] = $y['category_name']; // and do recursion if not a top level category if($y['parent_id'] != 0) { get_product_parents($y['parent_id'], $all_categories_array, $steps ); } } } $reverse_array = array_reverse($steps); $path = ''; foreach($reverse_array as $category_name) { $path .= '/' . $category_name; } return $path; } $steps = array(); $link_path = get_product_parents('4', $all_categories_array, $steps); // Should be /Examples/Widgets/Hardcore echo $link_path;
-
simplexml and parsing namespace with attributes
sKunKbad replied to ngoweb's topic in PHP Coding Help
Actually, I forgot something. You need to get an attribute. Consider this example: <?php $the_xml = <<<FEED <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> <id>http://eventful.com/atom/performers/bliminal-/P0-001-000192452-0</id> <link href="http://eventful.com/atom/performers/bliminal-/P0-001-000192452-0" type="application/atom+xml" rel="self" /> <link href="http://eventful.com/performers/bliminal-/P0-001-000192452-0" type="text/html" rel="alternate" /> <title>B-Liminal Tour Dates in 2009, B-Liminal Concert Schedule - Eventful</title> <subtitle>Up-to-date event feeds from eventful.com, the world's leading event website.</subtitle> <rights type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> Copyright © 2006 <a href="http://eventful.com/">Eventful, Inc.</a> All rights reserved. Use subject to terms of use: <a href="http://eventful.com/terms">http://eventful.com/terms</a> </div> </rights> <generator version="1.0">EVDB::Atom</generator> <opensearch:totalResults></opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <updated>2009-09-13T11:48:52+00:00</updated> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> <id>http://eventful.com/jupiter/events/bliminal-free-fan-appreciation-show-/E0-001-024704319-1</id> <published>2009-09-13T15:09:00+00:00</published> <updated>2009-09-13T15:48:12+00:00</updated> <link href="http://eventful.com/jupiter/events/bliminal-free-fan-appreciation-show-/E0-001-024704319-1" type="text/html" rel="alternate" /> <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed" /> <gd:visibility value="http://schemas.google.com/g/2005#event.public" /> <gd:transparency value="http://schemas.google.com/g/2005#event.transparent" /> <title>B-Liminal FREE fan appreciation show!</title> <gd:when startTime="2009-09-19T02:00:00+00:00" endTime="2009-09-19T02:00:00+00:00" /> <georss:where> <gml:Point> <gml:pos>26.9342076 -80.0922588</gml:pos> </gml:Point> </georss:where> <gd:where rel="http://schemas.google.com/g/2005#event" valueString="Corners near 71 East Indiantown Road , Jupiter, Florida, 33458, United States"> <gd:entryLink> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> <id>http://eventful.com/jupiter/venues/corners-/V0-001-001473018-9</id> <link href="http://eventful.com/jupiter/venues/corners-/V0-001-001473018-9" type="text/html" rel="alternate" /> <title>Corners</title> <georss:where> <gml:Point> <gml:pos>26.9342076 -80.0922588</gml:pos> </gml:Point> </georss:where> <gd:contactSection label="Corners"> <gd:postalAddress> 71 East Indiantown Road Jupiter, Florida 33458, United States </gd:postalAddress> <gd:geoPt lat="26.9342076" lon="-80.0922588" /> </gd:contactSection> <content type="html"> <div class='vcard'> <a class='fn org url uid' href='http://eventful.com/venues/V0-001-001473018-9'>Corners</a> <div class='adr'> <span class='street-address'>71 East Indiantown Road</span>, <span class='locality'>Jupiter</span>, <span class='region'>Florida</span> <span class='postal-code'>33458</span> <span class='country-name'>United States</span></div> </div> </content> <media:text type="html"> <div class='vcard'> <a class='fn org url uid' href='http://eventful.com/venues/V0-001-001473018-9'>Corners</a> <div class='adr'> <span class='street-address'>71 East Indiantown Road</span>, <span class='locality'>Jupiter</span>, <span class='region'>Florida</span> <span class='postal-code'>33458</span> <span class='country-name'>United States</span></div> </div> </media:text> <category scheme="http://eventful.com/venues/tags/" term="americantowns" label="American Towns" /> <category scheme="http://eventful.com/venues/tags/" term="americantownscom" label="americantowns.com" /> <category scheme="http://eventful.com/venues/tags/" term="artistdatacom" label="artistdata.com" /> <category scheme="http://eventful.com/venues/tags/" term="barnightclub" label="BarNight Club" /> <category scheme="http://eventful.com/venues/tags/" term="community" label="community" /> <category scheme="http://eventful.com/venues/tags/" term="local" label="local" /> <category scheme="http://eventful.com/venues/tags/" term="townsquare" label="town square" /> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#contact" /> <author> <name>evdb</name> <uri>http://eventful.com/users/evdb</uri> </author> </entry> </gd:entryLink> </gd:where> </entry> </feed> FEED; $feed = new SimpleXMLElement($the_xml); $namespaces = $feed->getNamespaces(true); foreach ($feed->entry as $entry) { $gd = $entry->children($namespaces['gd']); foreach($gd->when->attributes() as $k => $v) { $show_time[$k] = $v; } echo "<p>Event = " . $entry->title . "<br />startTime = " . $show_time['startTime'] . " and endTime = " . $show_time['endTime'] . "</p>\n"; } ?> That should be more than enough to show you what you need to do to get at an attribute of an element that is inside a namespace. -
simplexml and parsing namespace with attributes
sKunKbad replied to ngoweb's topic in PHP Coding Help
It's hard to tell without having the actual XML to play with, but from what you shared I'd start with something like this" <?php $the_xml = file_get_contents('http://the_file.xml'); $feed = new SimpleXMLElement($the_xml); $namespaces = $feed->getNamespaces(true); foreach ($feed->entry as $entry) { $event = $entry->children($namespaces['gd']); echo "<p>Event = " . $entry->title . "<br />startTime = " . $event->when->startTime . " and endTime = " . $event->when->endTime . "</p>\n"; } ?> -
First you need to query the database, then check if a result was returned, then turn the result into an array so that you can use it. Loop through that array to go row by row through the result that was returned from your query. You would fill in the blanks of your email, and send it, then move on to the next iteration of the looping. Sending the email is very basic, and you will find almost unlimited tutorials on the internet about sending email in php. If you don't understand this, you should read a beginner PHP/MySQL book, because this is the basics. It would be a good thing to learn as a simple first project because it involves a simple MySQL query, and using the result of the query in an emaiil.
-
In the head you could set a variable like $do_login = 1; and then in the body you could check if it is set: if(isset($do_login)) { display_login(); }
-
Magic Quotes disabled but still somehow working
sKunKbad replied to pigmonkey's topic in PHP Coding Help
They don't call them magic for nothing... So, are you sure that you can use .htaccess files? For instance, AllowOverride All? Maybe try to turn them off in php.ini? -
I am not sure what is considered to be an outside connection, but I have created an e-commerce application that you can use, or just look at the code to see how I made it: http://bitbucket.org/skunkbad/community-cart/ This is a CodeIgniter application. CodeIgniter is a simple PHP framework. I can't provide lots of free support, but with some effort you should be able to figure out how to use it.
-
if you echo md5(md5($_POST['pass']) . "rs-ps") and then you echo $realpass and they are the same, then no, i dont see your problem
-
did you really mean to md5 twice?
-
I hate Flash, so it was hard to like your home page. I'd rather see you have a simple fade in/fade out type image rotation. I'd also like to see that area a little smaller.
-
for instance: if (isset($champion) && strlen ($champion) < 1) { //line 45 or if (isset($con1) && strlen ($con1) < 1) { //line 54
-
<?php if ($req_user_info['name'] !=" ") { echo "<input type=\"submit\" value=\"Submit\">"; } else { echo "<input type=\"submit\" value=\"Submit\" disabled=\"disabled\">"; } ?>
-
if(isset($var)) { echo $var; // now you won't get the warning message, because you checked that it was set. }
-
Didn't know that. That makes a difference.
-
Yes, I could run two queries... I'm just always trying to do as little queries as possible.