Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

Jaguar's Achievements


Member (2/5)



  1. Yes, it works for YOU, but what about the person after you? (Assuming you're in a business setting.) There's actually a chance whoever comes after you will have experience with one of the popular frameworks. There is zero chance they will have experience with your custom framework. I inherited a custom framework at my job. I wish the person or persons before me had just used an open source framework. The popular open source frameworks (Cake, Zend, CI, etc.) are better documented and more thoroughly tested.
  2. Use Zend_Db_Table, not Zend_Db_Table_Abstract (e.g. "$db = Zend_Db_Table::getDefaultAdapter();")
  3. Do you have your the application environment defined? Assuming you're using the structure created by Zend_Tool, then a quick way and easy way to set it is to open up public/index.php and at the very top add define('APPLICATION_ENV', 'development'); Just make sure to remove that line when you are done testing. Also make sure you have error reporting turned on in the php.ini file.
  4. I thought that might be the answer. Was hoping one method was more dominant. The example I give is actually a tad nicer than his real code. He likes to take his functions into separate files. So it's more annoying form me to follow and debug. In this example there would be a file add_widget.php which includes a file add_widget_functions.php. I've been looking at the code from popular open source projects to see how they do it. I see both ways and to varying extents. Like PHPBB seems more like my style. WordPress seems to be more like his. Is there a technical name for either style? I'd like to read more about the more function heavy way.
  5. It seems like you're not pointing to the right path. Is testflash.flv in the same directory as delete_video.php? You probably need to exactly where the video files are stored. Right now PHP is looking for the file in the same directory as delete_video.php. So I would try changing unlink($file); to unlink('C:\path\to\your\videos\' . $file);
  6. The date_default_timezone_set() function doesn't change the format you have to use for inserts. You will have to reformat the users input.
  7. I work with another guy who is relatively new to PHP programming as I am. Neither of us have any education in programming. We've both developer different styles and I'm wondering if I should adopt his way. I only create functions and objects for redundant tasks. He creates extremely specific functions for organization, which I can see a benefit in. However it creates a more complex flow because it jumps from function to function more often. So his code would look something like... <?php if(add_widget()) { send_widget_confirmation_email(); } else { print_widget_form(); } function add_widget() { check_for_duplicate_widget(); // insertion sql } function check_for_duplicate_widget() { // sql for checking if it exists already } function send_widget_confirmation_email() { // mail code } function print_widget_form() { echo '<a bunch of html>'; } ?> If I were doing this I would get rid of the functions and move the code from inside the functions to the if/else statement since these functions wouldn't get used in any other file. Also that way the program reads more top to bottom. Though maybe it isn't as obvious to see what each portion does.
  8. Also you just FYI you should use $SID = mysql_escape_real_string($SID); Your script right now would be very easy to exploit. Someone could drop/delete your students table.
  9. Here's my site structure (very simplified)... index.php blog/ index.php post.php forum/ index.php post.php Now I want to create a basic template system, but I'm not sure how to store my template files. I can think of a couple ways. One template directory with all the files. The drawback is I might have to get clever with naming the files or the the file names could get long. templates/ header.tpl footer.tpl index.tpl blog_index.tpl blog_post.tpl forum_index.tpl forum_post.tpl Or a template directory in every directory. The drawback is I will have to include files from multiple directories. templates/ header.tpl footer.tpl index.tpl blog/ templates/ index.tpl post.tpl forum/ templates/ index.tpl post.tpl Or multiple directories inside a single template folder. templates/ header.tpl footer.tpl index.tpl blog/ index.tpl post.tpl forum/ index.tpl post.tpl I'm guessing this last solution is the right way, but I like the simplicity of the first method (one directory).
  10. Yeah, yeah. I have my pages setup that way now. The problem I'm having is with my header file. It has a lot of variables and is included on many different pages. The problem is I do not set some of those variables on every page. So, warnings pop up. Yes, I know I can disable the warnings, but I'm anal and find warnings unacceptable. The solutions are: 1. Use isset() in the header template file. I don't want to do this because I'm trying to keep functions of the template. 2. Set all the variables used in the header on every page. This seems wrong because I end up with a HUGE list of $var = NULL. 3. Use a template system that will convert <?php if($show_button): ?> (or <!-- IF show_button -->) to <?php if(isset($show_button) && $show_button): ?>. I know other template systems do this, but I prefer the HTML comment syntax. 4. ??? maybe you can think of something else?
  11. Does anyone use QuickSkin? http://quickskin.codeworxtech.com/ It uses syntax like <!-- IF true --> do this <!-- ELSE --> do that <!-- ENDIF --> I really like the style, but it doesn't seem very popular or well supported. I know of Integrated Template, but from what I can tell it doesn't support if statements, which I want. Does anyone know of any similar template systems that support if statements, includes, and loops using HTML comment style?
  12. I found the answer in the comments of the PHP docs. Here's how you fix it if anyone stumbles across this in the future: ini_set("mssql.textlimit", "65536"); ini_set("mssql.textsize", "65536");
  13. I don't know the specification, but couldn't you flag the email as important or urgent if you want to make it stand out.
  14. Why not insert HTML to begin with? If you do not want to store HTML in your database, you should look into using BB code.
  15. I have a description field (text type) in an SQL Server 2005 database. Some of the descriptions in the database are long, 4500+ characters. When I select and try to print the descriptions, they get cut off at 4100 characters. Has anyone experienced this? I tried inserting values over 4100 characters long into the database through PHP and it works, but selecting the value back gets cut off at 4100 characters in PHP. $sql = "SELECT name, description FROM Users ORDER BY name;"; $result = mssql_query($sql); while($row = mssql_fetch_assoc($result)) { echo $row["name"] . ":"; echo "<br /><br />"; echo $row["description"]; }
  • 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.