Jump to content

tarlejh

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tarlejh's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, I am having MySQL driver issues while trying to compile PHP 5.3 on Ubuntu Linux. I believe I have the correct extension path set in php.ini, and ran the configure command with: --enable-pdo=shared --with-pdo-mysql=shared --with-sqlite=shared --with-pdo-sqlite=shared --with-mysql Everything looks OK during the compile, but afterwards I am still seeing: PHP Warning: PHP Startup: Unable to load dynamic library './php_pdo_mysql.dll' - ./php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0 Isn't a DLL a Windows file? I'm on Linux, so why is PHP trying to load this at all?
  2. Hi, I need some clarification of a simple O-O concept. Within a class (in the example below for instance), does the "$this" variable refer to the object, or a does it only refer to a copy of the object? Thanks. <?php class Foo { public $prop; public function bar(){ echo $this->prop; } } ?>
  3. How would they be able to read your source code without cracking into your server? And why use "http://" in your path when you can include it from the filesystem rather than over TCP/IP? Normally you'd want to keep your database configuration (e.g. constants defined in "config.inc.php") above your web document root.
  4. I have a simple tabbed set of divs using JQuery. The JQuery looks OK since you can navigate through the divs, but the CSS that is supposed to create the actual tabs kicks them all over to the left, so that they're stacked on top of each other vertically, rather than laid out horizontally, adjacent to each other from left to right. Here's the code: !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" xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> a { outline: none; } .ui-tabs .ui-tabs-hide { display: none; } .ui-state-active a { color: #fff; } .ui-state-active a.CANav-1 { width: 50px; background: blue; } .ui-state-active a.CANav-2 { width: 50px; background: blue; } .ui-state-active a.CANav-3 { width: 50px; background: blue; } /* Blog Module Nav (Tabs) ----------------------------------------------------------- */ #CAContainer { padding: 42px 10px 14px; background: blue; margin: 0 auto; } #CAContainer a { text-decoration: none; color: #209ce7; } ul#CANav { list-style-type: none; margin: 0; padding: 0; } ul#CANav li { } ul#CANav li a { display: block; width: 58px; height: 17px; margin-right: 1px; padding: 0; border-top: 1px solid #ccc; border-left: 1px solid #ccc; border-right: 1px solid #ccc; } ul#CANav li a.last { margin-right: 0; } ul#CANav li.CANav-1 { background: blue; } ul#CANav li a.CANav-1 { width: 94px; } ul#CANav li.CANav-2 { background: green } ul#CANav li a.CANav-2 { width: 94px; } ul#CANav li.CANav-3 { background: yellow } ul#CANav li a.CANav-3 { width: 94px; } ul#CANav li.CANav-1 a:hover, ul#CANav li.CANav-1 a:focus { background: blue; } ul#CANav li.CANav-2 a:hover, ul#CANav li.CANav-2 a:focus { background: green; } ul#CANav li.CANav-3 a:hover, ul#CANav li.CANav-3 a:focus { background: orange; } /* Blog Modules ----------------------------------------------------------- */ #CA-1, #CA-2, #CA-3 { width: 305px; background: #fff; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } #CA-1 { border-top: 3px solid #F69123; } #CA-2 { border-top: 3px solid #F69123; } #CA-3 { border-top: 3px solid #F69123; } #CA-1 h2, #CA-2 h2, #CA-3 h2 { font: bold 1em/2em Helvetica, Arial, sans-serif; margin: 5px 0 0; } #CA-1 div, #CA-2 div, #CA-3 div { padding: 6px 0; } #CA-1 div a, #CA-2 div a, #CA-3 div a { color: #000; font: bold 1em/2em Helvetica, Arial, sans-serif; padding: 2px 6px; text-decoration: underline; background: #fff100; } #CAContainer ol { list-style: decimal inside; height: 108px; /* 128px */ margin: 0 10px; padding: 10px 5px; color: #209ce7; font: bold 12px/22px Helvetica, Arial, sans-serif; border-bottom: 1px dashed #ccc; } #CAContainer ol a:hover, #CAContainer ol a:focus { background: none; color: #55c6f2; } </style> <script language="JavaScript" src="http://img.sparknotes.com/js/jquery.js"></script> </head> <body> <div id="CAContainer"> <ul id="CANav"> <li class="CANav-1"><a href="#CA-1" class="CANav-1">Most Emailed</li> <li class="CANav-2"><a href="#CA-2" class="CANav-2">Most Commented</a></li> <li class="CANav-3"><a href="#CA-3" class="last CANav-3">Most Viewed</a></li> <div style="clear: all;"></div> <div id="CA-1"> Section 1 </div> <div id="CA-2"> Seciton 2 </div> <div id="CA-3"> Section 3 </div> </div> <script language="JavaScript" src="nav.js"></script> <script type="text/javascript" src="ui.core.js"></script> <script type="text/javascript" src="ui.tabs.js"></script> </body> </html> It's a longshot, but are they any CSS gurus out there that can see the problem just by looking at this code? If so thanks in advance for any help.
  5. I'm aware these are used for different situations, but can classes, abstract classes, and interfaces all be thought of as abstractions? For instance, supposing you have data that is presented as HTML. You have abstraction layers underneath it: HTML -> XML -> class -> abstract class , etc.. Is it correct to say that an abstract class, while more abstracted than a class, basically serves the same purpose in OO theory?
  6. Why would someone use vi exclusively? Do real developers really only use vi? I understand the advantage that you don't move your hands away from the keyboard in vi-- but you still have to compensate with extra keystrokes just to move the cursor. So it seems like people still use it only because it allows you to edit right on the server and comes with any Unix or Linux OS. Even having mastered the learning curve, to say it is faster than a modern text editor is ridiculous: Suppose you want to indent a 20 line block of code. In a GUI editor, selecting it with the mouse and hitting tab cannot take more than half a second. It would take a vi user at least a few seconds to do the same task. I use vi often to edit on the server when I don't want to FTP over and over. But I still cannot see using it as your main IDE.
  7. So I'm using file_get_contents to retrieve an XML file over HTTP. I'm using ini_set() to time out the default socket at 5 seconds. In my code, I am parsing the XML into an simple 2D array which I iterate through after checking that it is not empty: if ( !empty($myarray) ) { //break; } else { //assign hardcoded data to $myarray } //iterate through $myarray or something to that effect. A problem arises that sometimes the array is empty, maybe one out of every 50 page loads or so. Can't seem to determine why this could be, except that file_get_contents() is taking longer than 5 seconds. Yet I've timed that particular call (in a dev environment) and cannot get it to take longer than 3/100 of a second. Any help from the community with this vexing issue is much appreciated.
  8. A bot - or anyone who wanted to - can easily get around your javascript validation. If validating client side was effective, there would be no need for captchas, etc. To answer your inquiry, how they are getting around your javascript is beside the point. Any time you put a form on the net you should: a. validate server-side b. filter input c. escape output Google or read the php manual for some techniques.
  9. So I want to accept a URL that might contain a 7-digit number (e.g. http://www.domain.com/index.php/#1234567). If it does contain a 7-digit number, I want to grab it from the string and assign it to a variable. If it does not, I want to assign false. So how might this be achieved? Using some string handling function or combination thereof (duh) but can anyone here code it off the top of their head? Thank you in advance for any assistance.
  10. So I am trying to have PHP execute shell commands or programs, in particular svn and rsync. It's useless. It executes cd and pwd, just fine, and will even run a shell script, but I have no luck executing svn, rsync, or even whoami, by themselves, or within a shell script. PHP is running as "nobody" which I think is the root cause of this. So, how can I give user nobody permission to access our svn repository or at least run rsync?
  11. Those two arrays are identical. An array is always a set of key/value pairs. The keys can be numeric or associative. If you don't explicitly set the keys, and just do: array('x', 'y', 'z') PHP assigns a key of 0 to x, a key of 1 to y, etc. HTH
  12. I work on a high traffic website. As a php developer, I have little say as to how the client side code is written, but our website is suffering huge performance problems. Here are some stats for what happens when you browse our site on an empty cache: 26.8K 2 HTML/Texts 10.3K 2 IFrames 290.5K 4 Flash Objects 82.9K 12 JavaScript Files 50.5K 5 Stylesheet Files 76.8K 12 CSS Images 238.6K 17 Images 776.6K Total size 54 HTTP requests I'm a developer not a designer (but I know that making 54 http requests is not a good idea). And unfortunately the original html author is no longer with us, so there is no one here we can task with tidying it up. Would anyone care to share their thoughts?
  13. So what is the question? Data model looks OK, but you could spend about a year learning only the basics of database and application design (so I'm afraid you'll need to be a bit more specific as to where you're having trouble). There are undoubtedly better developers lurking that could reply to this - but if I were coding it: In general, you divide the application into some number of abstraction layers, or what is known as an n-tier design. For example, runnerview.php This page is html. Should be no PHP in this page, except perhaps iterating through arrays or objects. To strictly separate PHP and HTML, you might use placeholders for dynamic values ( e.g. {value} ), leaving only a HTML template. controller.php This page is in charge of making the view responsive to user input. To put it another way, it would accept an argument (as some sort of input) for some sort of parameter and hand it off to a database, (e.g. generate a page based on the runner's last name.) model.php This page would be in charge of setting and getting data from a database - looking up a runner's result, adding deleting editing runners, etc. It communicates with the database and returns a resultset or an object. This is the only part of the application allowed to address the database directly. Look in the manual for PDO or use a third party ORM like Propel (google it if you've never heard of this). Now whether this is the best way to design an app is open to to debate, but it should get you started.
  14. OK thanks...so, is it always good practice to abstract your object model down to abstract classes? Can you abstract an abstract class? Where does it end?
×
×
  • 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.