Jump to content

rxbanditboy1112

Members
  • Posts

    116
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rxbanditboy1112's Achievements

Member

Member (2/5)

0

Reputation

  1. yeaaaaa, i've been trying to find a good place to post. It seems that there is a limited amount of resources for cake. Sometimes no results for some issues... Especially for this question. I have been stuck for the past 2 or 3 days with this issue. Although, i think after this it should be smooth sailing. Its just not grabbing the data from the table. I see the table and column names in the array but the result is blank. I don't get it. It happens in all versions of cake of me so i know it isn't a distro problem. I am gonna post else where also, but if anyone has used cake before here and knows what i am doing wrong let me know!!
  2. So I have a MVC for Events and Event Categories. I am trying to have the name of the category appear on the event page. I am associating events as belonging to event categories with a field called cat_id. I am able the retrieve the tables, but for some reason the event category part of the array ends up empty. Visually I am trying to make it look something like: Concert: Annual Event Where Concert is equal to a cat_name which is associated by cat_id(in the event table) = id(in the event categories table) and Annual Event is the event_title (in the event table). Getting data from the event table is no problem. I used print_r($event[0]) to show data from the first entry: Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id] => 6 [event_title] => Miggs, Your Last Chance, Kyle Reece, The Strategy, PK, Kinderghost [event_date] => 2008-02-09 [event_hour] => 6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00 [event_tickets] => 6 [event_venue] => San Jose Skate [event_address] => 397 Blossom Hill Rd. [event_city] => San Jose [event_state] => CA [event_zip] => 95123 [event_caption] => This Event Will be Will Call bring your ticket for faster service though. Oh the rock will be endless, and the merriment will be a plenty. [event_body] => This Event Will be Will Call bring your ticket for faster service though. Oh the rock will be endless, and the merriment will be a plenty. [event_author] => 1 [event_read_count] => 1339 [event_h_story] => 1 [event_capacity] => 0 [amount_sold] => 0 [event_enabled] => 1 ) [EventCategory] => Array ( [id] => [cat_name] => [cat_description] => ) ) If you notice the EventCategory part of the array is empty for some reason.... Event Model: <?php class Event extends AppModel { var $name = 'Event'; var $hasOne = array( 'EventCategory' => array( 'className' => 'EventCategory', 'foreignKey' => 'id' ) ); } ?> Event Category Model: <?php class EventCategory extends AppModel { var $name = 'EventCategory'; var $hasMany = array( 'Event' => array( 'className' => 'Recipe', 'order' => 'Reciped } ?> Event Controller: <?php class EventController extends AppController { var $name = 'Event'; function index() { $this->set('event', $this->Event->findAll()); } } ?> Event Category Controller: <?php class EventCategoryController extends AppController { var $name = 'EventCategory'; function index() { $this->set('eventcategory', $this->EventCategory->findAll()); } } ?> Sorry, I know this is a bit lengthy, but I figured I would give a bunch of details rather than be vague. Hope someone can help.
  3. I just use a script when they upload it checks: $known_photo_types = array( 'image/pjpeg' => 'jpg', 'image/jpeg' => 'jpg', 'image/gif' => 'gif', 'image/bmp' => 'bmp', 'image/x-png' => 'png' ); // GD Function List $gd_function_suffix = array( 'image/pjpeg' => 'JPEG', 'image/jpeg' => 'JPEG', 'image/gif' => 'GIF', 'image/bmp' => 'WBMP', 'image/x-png' => 'PNG' ); // Fetch the photo array sent by preupload.php $photos_uploaded = $_FILES['photo_filename']; // Fetch the photo caption array $photo_caption = $_POST['photo_caption']; while( $counter <= count($photos_uploaded) ) { if($photos_uploaded['size'][$counter] > 0) { if(!array_key_exists($photos_uploaded['type'][$counter], $known_photo_types)) { $result_final .= "File ".($counter+1)." is not a photo<br />"; } ....etc
  4. They can only upload png, gif, jpg, jpeg or bmp under a certain size.
  5. oh, i prevent people from seeing the apache index stuff on all folders...
  6. Thanks! I read some info about it, and it seemed like I already use some of those practices. Just gotta refine some things. One more question. I have a folder to upload files to via a script on my server. This script is secure; however, the folder itself is world-writable. Is this folder in danger? I have a shared hosting account. I was thinking about using a function that changes chmod; however, I think if multiple people are uploading at the same time it will interfere.
  7. OOo i didn't know that. Should I be accessing php files with my IP address and then go to the correct directory. By faulty security practices do you mean not checking for file extensions via some sort of upload form? Should there be anything else to be concerned with in the security department? How about with payment processing going through something like paypal? Anywhere I can find more info about keeping stuff secure online/php?
  8. Hmm well the goal is to stop harvesting, spam and other things like that. Also i thought everything in php was basically open source? How can you make it closed source? Is it possible for people to download php files and just view them like that? Everytime i have tried that it always just gives me the output.
  9. Well I suppose that would also depend on if they had cookies enabled? Maybe a session variable unless that depends on IP address....
  10. Hmmmmm, I suppose if i were able to track a user via a cookie, and detected an IP change I would know they are a malicious bot correct? Is there anyone else that would swap out IPs like that?
  11. I know captcha is a nice way of blocking out bots, but as an additional measure. I'd really just love to block them out completely. It is truely a pain in the ass. I may share code after I am done, no promises haha....
  12. Yes IP Addresses. So should I be blocking proxies ( not exactly sure what they are, but ill read up on them )? What are standard measures that people take? Or unstandard considering everyone has spam issues with email, commenting systems, and bots searching for email addresses.
  13. Does anyone know of any database that could contain a lot of that sort of information? Possibly one that is kept up to date? I am looking to create a php class that will ban malicious people, organizations, programs and others from my website... Does anyone know about any tools that have already done this?
  14. I've been programming with php for a while now in a more script like way with some classes here and there. I am also experienced with java and c#. Now I am trying to rewrite my code to make it object oriented because that is what I am used to and definitely what makes sense. I was wondering does php have public, private and maybe even protected functions? Are all functions public? Furthermore, this style of programming makes me want to specify type, rather than just commenting on what type something should be. Is there a way I can declare a type to my variables? Also by default are variables in php set to public or private? THanks!!
×
×
  • 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.