Jump to content

linuxdream

Members
  • Posts

    124
  • Joined

  • Last visited

    Never

Everything posted by linuxdream

  1. Ahh, thanks for the consolidation tip. I'm on FF 3.0.11 on Mac. Yea, I would think I should work fine, I'll have to debug more and see what else may be causing it. Thanks for the outside check!
  2. Most likely the file (or that file's parent directory) you are trying to include is not readable by the web server. Be sure your web server have access to read the directory and file (not sure how to do that on a Win. box).
  3. Sorry for the dumb question but I normally don't do CSS much. If you have div block and apply two classes to it, one containing a width and the other containing auto left and right margins, why won't it center the block? .width150{ width: 150px; } .blockCenter{ margin-left: auto; margin-right: auto; } <div class="width150 blockCenter"> content here </div> It centers the block fine when I put the width and margins in one CSS class. But shouldn't it work fine separated like the above code since the width should be seen for the margins to center properly? Any help is appreciated.
  4. Well, as long as you have some sort of header file that is included at the of each page (using the idea of one template for many looks, this is a given) then you can just parseurl() out the host portion and set it in each script. Or pass it around as a cookie or session data. This is how we use a single template for 30+ clients at my work. We actually have a function that is called automatically at the beginning of every page that automatically gets the host portion and keys everything off that. For the database side, I suppose you can have a separate DB for every "team" but you could also just as easily combine them into one big table (like data...meaning account info in one table, settings in another, etc.) and index the proper fields. Performance is good and you only have to manage a few tables in one DB instead of duplicate DB's or tables for each "team." Key them off the unique host and use that host for managing everything for that specific "team."
  5. Looks like they are simply using a standard template for the layout and custom style sheets for each "team." Something like: <?php $host = parse_url($_SERVER['HTTP_HOST'], PHP_URL_HOST); require_once('/cssdepot/' . $host . '.css'); ?> placed at the beginning of the template would work to include each custom css file based on the host. You would just have each custom css file stored in /cssdepot/ named after each "team."
  6. Looks like you are simply running the same query over and over since you want the result of mysql_fetch_array in the $events, not the the method getEvents(). That will simply keep running the same query and not iterate through the result like you want. You could simply assign mysql_fetch_array($results) to a class variable and call it in place of getEvents(). That way you will have a constant value there and not a new method/SQL query each iteration...which is what you need.
  7. <?php $data = array('somethign', 'nothing', 'again', 'and again', 'without', 'anything'); $rand = rand(0, count($data)-1); echo $data[$rand]; ?> Might work too.
  8. Push is used to "push" an element onto the end of an array. I would break up the return info. <?php .... $text = ""; foreach($menu as $item){ $text .= "jsmenu.push($item)\n"; } return $text; //$text will have all the js push items to be echo'd out later ?> Adding whatever tags you need before or after the foreach results in $text. That would work better (and is more readable) than your previous return.
  9. But you can include a .html file into the php file you have the include() in....
  10. Not sure if it matters since I don't have experience on Windows machines and PHP...but the file path looks to be in UNIX style not Windows.../ vs \
  11. Cool, thanks. My JS skilz are about a -3 right now.
  12. By default, I believe PHP passes the session id as a cookie (your problem) but then tries to pass the session id in the URL if cookies are not enabled. Not sure why it wouldn't work, but you might want to check your server's php.ini config file to see if for some reason only cookie based session handling is being supported. Maybe you can enable session handling through the URL.
  13. PHP only processes on the server side so you can't expect it to process through javascript unless you submit the form again or use AJAX. Your rand_pass() must be javascript to be used in this case...or else it only gets used once (as is the problem you are experiencing). Otherwise, you will have to submit the form and reload the page...or use AJAX.
  14. It is but you have to be a bit more precise in the definition... <?php $menu = array('apple', 'banana', 'peach'); echo "<script>\n"; echo "var jsmenu = new Array();\n"; foreach($menu as $item){ echo "jsmenu.push($item)\n"; } echo "</script>"; ?> Should work...
  15. I think it depends on what your needs are. I have experience with Symfony. It's not bad..very well organized but the propel DBA layer makes complex DB access a bit difficult.
  16. I may be completely off but... for($x=1; $x<11; $x++) { I didn't know you could have more than two ; in a for statement.
  17. Showing my ignorance here...but what PHP version are you using. I think try/catch was introduced in PHP 5
  18. Could use fopen...http://us2.php.net/manual/en/function.fopen.php for a quick and dirty way of doing it. Or file_get_contents for an even simpler way...http://us2.php.net/manual/en/function.file-get-contents.php (no file handles or anything).
  19. SSL in Apache is different from SSL in PHP. Did you read the page that you posted?? So, you need to install SSL under Windows and be sure the DLL's are in your path. No clue how to do this since I work in Linux.
  20. try a print_r($reason); above the <select> to be sure the variable is getting there and what the contents are. If that doesn't work, then start with the print_r in the require page...then keep moving it farther away (closer to your <select>)until you discover where the problem is.
  21. Thanks, Seems to work without them though.
  22. are those back tick's you are using for $table? try using just regular '
  23. Also ripCURL http://sourceforge.net/projects/ripcurl will let you get the page and has data parsing methods to pull whatever might need.
  24. If it's in the body then it can't be used as a mailing address like CC or BCC. If they were editing the header..that would be another story.
  25. You don't need to know the structure...you can jump directly to VALUES if each value corresponds to your table structure. Try enclosing the $table in '{$table}' instead. You don't really need the 's there unless you have a weird table name. So try {$table} too..
×
×
  • 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.