Jump to content

eazyGen

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by eazyGen

  1. Many thanks, Sorry to appear lazy, but I was in a mad rush. S
  2. Hi guys, I would normally research this myself, but I am in a hurry just now. My question is - how would I take a string like: "Customer Name" or "Product Cost Price" and produce a result where all upper case letters are made lower case and all spaces replaced by under-scores. Like this: "Customer Name" would become "customer_name", and "Product Cost Price" would become "product_cost_price" Many thanks for any swift help, S
  3. It is not that simple when the app I am building will be used by others whose hosting I cannot dictate. Ergo - I need to consider the most basic set of features around and proceed on that basis. NOT simple at ALL.
  4. Hi Guys, I am building an app that I know will be deployed on a LAMP server but where I am not in control of the MySQL database engine. It could be InnoDB or it could be MyISAM. Or it could be something else for that matter. My app has some pretty complicated updates that are tightly related and represent what folk call a “transaction”. In other words, and in an ideal world, all my updates should succeed or none should. The classic example is the bank transfer: UPDATE account1 SET balance=balance-500; UPDATE account2 SET balance=balance+500; Both or none please. I have been reading up on MySQL transactions, commit and rollback etc; and I am seeing what I would more or less expect (my background is with IBM's DB2). However, I have been searching around, and, from what I have read thus far, it seems that MyISAM does not support row level locking - only table locks (which is madness in my book). So I thought I would ask here how folk achieve guaranteed transaction integrity if they are forced (by the host for example) to use MyISAM. Or do you just put up with this db engine limitation? Many thanks in advance. S
  5. How exactly did you notice that, because the method used could be giving you false information or could be converting the value. I beg your pardon, I think I may have misled you. I made use of the function mysql_insert_id() and then ran it through a debugger. The debugger I used was the one that comes with PhpED: http://www.nusphere.com/products/php_debugger.htm The result was a value of "long". I then ran this code: $qry = "SELECT LAST_INSERT_ID()"; $b = mysql_query($qry); and $b ended up with a type of mysql result. Perhaps I am doing something wrong here. My most important issue is that I must know the type of the integer that comes out of the code as I need to populate a BIGINT with a length of 13. I have searched around but I cannot seem to find a great deal of clarity on this topic. If I cannot get this method to work, I may have to use a different technique. Any comments most welcome. S
  6. Back again on this chaps. I have looked at the documentation for mysql_insert_id() and it says: mysql_insert_id() will convert the return type of the native MySQL C API function mysql_insert_id() to a type of long (named int in PHP). If your AUTO_INCREMENT column has a column type of BIGINT (64 bits) the conversion may result in an incorrect value. Instead, use the internal MySQL SQL function LAST_INSERT_ID() in an SQL query. I have a bigint as the key if my table, so I looked at the LAST_INSERT_ID(). However, during testing I noticed that LAST_INSERT_ID() returned a value with a type of long, which I believe has a maximum value up to: 2,147,483,648. So this doesn't seem to be the solution. Has anyone overcome this issue? Many thanks in advance. S
  7. Looks good - thank you. More information: http://uk3.php.net/mysql_insert_id S
  8. Hi Guys, Using MySQL, I have a table with an auto increment key. I add rows to this table happily enough. However, is there a simple way of obtaining from the db the value that was allocated by the auto increment? Many thanks in advance, S
  9. == How can your page be wider? This is all controlled by your browser FF and that should be the same size wither displaying a local file or one from the internet. Maybe your environment on your computer displays in FF differently that true FF via the internet. Maybe your zoom is set wrong. Hit ctrl-zero to reset that and check internet again. Well I'll be jiggered. You prompted me to play around with the zoom settings. I zoomed out once and the page was fine. I then closed the browser, re-opened it and went back into my test page and it was still good. I visited a few other web pages and they were fine too. This would seem to mean that zoom settings are stored for each page on FF ? I must have zoomed in on my test page either by accident or for some reason, not realising my zoom would persist across browser settings. Is that right behaviour would you say? Either way, many thanks for pointing me in the correct direction. S
  10. Thank you both. There is good food for thought here. S
  11. If that is the case, and I must say I find it slightly odd that something so apparently simple should not come with a guarantee, is there a "best practice" to achieve what I am aiming for? Perhaps a settings.ini file??? S
  12. Many thanks. However, this seems to highlight the problem I am having and the reason for my post. The link has two statements that concern me: $HTTP_SERVER_VARS [deprecated] ... so I cannot use that. "$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these ..." I am loathe therefore to pursue a solution that carries no guarantees. Any further thoughts much appreciated. S
  13. Hi guys, I am searching for the definitive way of obtaining the root directory of my app. I need to it to work on localhost and also on ALL platforms, NIX, Windows etc. I would like to do this as I wish to use it to locate all my sub directory files - includes, model etc. For example, I may have this as my landing page: http://www.mywebsite.com/index.php The root directory might be: html The index.php might reside here: html/index.php ... but my includes files might be here: html/lib/includes So I would be looking to obtain the root in an absolute kind of way to allow me to string together the includes sub directory in a relative kind of way. In summary then: 1. How to obtain the root with 100% percent success, all of the time on all platforms. 2. How to string the sub directory together with 100% percent success, all of the time on all platforms. 3. Any comments on this as an approach, also welcome. Many thanks in advance, S
  14. Thank you kindly sir. I just wrapped __autoload into my app and it is working nicely. I appreciate your thoughts and comments. S
  15. Thanks for getting back to me. Here is the whole page - it is small - a simple log in with little validation at this time: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-gb"> <head> <title>Login to eazyGen</title> <meta name="description" content="eazy-Gen" /> <meta name="keywords" content="Code Generator" /> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta name="generator" content="eazy-Gen" /> <meta name="robots" content="index,follow" /> <link href="../client/css/ezLogin.css" rel="stylesheet" type="text/css" /> <link href="../client/css/ezControls.css" rel="stylesheet" type="text/css" /> <link href="../client/css/ezFacts.css" rel="stylesheet" type="text/css" /> <link href="../client/css/ezGlobalCSS.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="../client/images/logos/favicon/favicon.ico" type="image/x-icon" /> <link rel="icon" href="../client/images/logos/favicon/favicon.ico" type="image/x-icon" /> </head> <body id="body"> <!-- Body --> <div id ="ezContainer"> <!-- Outer Container --> <div id = "ezHeaderLogo"><img src="../client/images/logos/eazygen_logo.gif" alt="eazyGen Logo" title="eazyGen - the Web Site Generator" height="52" width="82" /></div> <div id = "ezHeaderText">eazyGen - The Web Site Generator</div> <div id = "ezHeaderLine"><hr></hr></div> <form id="ezLoginForm" method="post" action="ezLogin.php"> <!-- Log In Form --> <p><label for="username" class="formLabel">Username :</label> <input type="text" name="username" id="username" class="formInput" value=""/></p> <p><label for="ipassword" class="formLabel">Password :</label> <input type="password" name="password" id="ipassword" class="formInput"/></p> <p><input type="submit" name="submit" value="Login" class="ezButton"/></p> </form> <!-- End Log In Form --> </div> <!-- End Outer Container --> </body> <!-- End Body --> </html> And here is the main CSS for the page: This is the CSS - I have commented out the selectors and classes to aid posting into the forum !!! /* Log In Style Sheet */ /* This contains the whole page. */ /* Header */ //#ezHeaderLogo { padding-left:10px; padding-top:10px; float: left; } /* End Header Logo */ /* Header Text */ //#ezHeaderText { padding-right:10px; padding-top:10px; padding-bottom: 0px; font-family: helvetica, courier; float: right; font-size: 24pt; color: #0D658E; } /* End Header Text */ /* Decorative Line */ //#ezHeaderLine { padding-right:5px; padding-top:0px; width: 55%; height: 2px; float: right; color: #0033CC; } /* End Decorative Line */ /* Main Container */ //#ezContainer { width: 1024px; height: 1000px; padding: 0; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; background-color: #ffffff; border: solid 2px; border-color: #575757; } /* End Main Container */ /* The Form */ //#ezLoginForm { position:relative; border-radius: 25px; box-shadow: 2px 2px 4px grey; margin-top: 200px; margin-left: auto; margin-right: auto; border: 1px solid #BEBEBE; width: 600px; height: 180px; padding: 50px; } /* End The Form */ //#ezLoginError { margin-left: auto; margin-right: auto; } /* Body Style */ //#body{ background-color: #c0c0c0; background-image: url("../images/decoration/binary.jpg"); background-image: repeat; margin: 0%; } /* End Body */ Any further assistance much appreciated. S
  16. H guys. This may be a daft question. I have an app that I am building and testing locally using Firefox. Periodically I upload the files to my server's test environment. However, when I run the same code there, again using Firefox, I am finding that my CSS seems to be messed up because my page is wider. I have checked that all the files are present and correct and had a look using Web Developer, but I cannot quite understand what is going on. My local host is using Apache via XAMPP, and my test server is also running Apache. Is there something simple that I may need to do to ensure each environment is the same? Many thanks in advance for any assistance. S
  17. Hi guys, I am looking for a PHP editor that has the best debugging facilities possible. Can anyone recommend such a tool? Many thanks, S
  18. Thanks guys. But I need to think some more. I am aiming for rigour and consistency for every form, for every data type, and even for more complex business rules. S
  19. I would say that this is the single most important statement in the whole topic. To base your validation on an expected type of user could be troublesome I would say. What would happen if the user type changed? Maybe they start employing low paid clerks? Then you could in in trouble. The app would "break" because a different person is sat in front of it S
  20. Hi guys, What techniques do you use to process, validate, and then show errors on your forms. Do you set an "action" to the same form and then handle errors somewhere? Do you use a separate script to process validation? What standards do you apply for the position of the error messages? Do you alter the "look" of any fields in errors (make them red for example)? Do you have a good standard strategy that can be applied for all forms in a re-usable fashion? Perhaps using functions? I am looking for a robust, user friendly (and coder friendly come to that) solution to this frequently encountered situation. Many thanks for any help. S
  21. An open question this, and one that may or may not bear fruit. But here we go anyway. index.php is a special case I feel because it is often the default script that is called for a web site. Moreover, I keep mine in the freely available root directory, but the rest of my php is out of the root for security purposes - in a directory called "lib". The app I am working on at the present time requires that a user logs on first. So, the code I have in my index.php is very simple: <?php /* Require Log In */ require("lib/ezLogin.php"); ?> This at least is what I have presently. So I have a few questions: 1. Is treating index.php as a special case, a reasonable approach would you say? 2. Is the separation of the rest of the non-client php files a real security improvement? 3. When you declare the css path, do you use absolute path names? If so, how might it be done so it will work on local (testing) AND the main server (production) with no code change? 4. includes_path - I assume this is the path to the includes directory. However, I am not sure/happy/comfortable with this just yet. Can more than one path be included in this? (I have Googled around but still unhappy) If so, how so? Does this approach works across platforms? If not, is there a way to make it? Many thanks for any help. S
  22. Hi guys, I am viewing a tutorial that is a little out of date, but which does address the issue of stripping special characters from strings prior to using them in an SQL update statement. What I would like to know is: 1. What is the very latest mechanism available to ensure your strings will be sent to the database with no special character problems? 2. Is the solution specific to MySQL, or does it hold good for other SQL databases? Many thanks in advance, S
  23. What did you actually look at? The notice that said "could not connect". I looked too at Chrome that worked. And my hub and wireless adapter. Everything seemed to be in order, in so far as I could see, except FF. Should I have looked at something else? S
  24. Hi all, I installed Firefox 6.0.1 a couple of days ago, but when I came to use it today it wouldn't connect to any web site. I couldn't see why. I reinstalled 6.0 and all was well again. Anyone experienced this? S
  25. After having given this a little more thought I have some further questions – many thanks for any responses. I can see that your client directories and files (plus the index.php, and the .htaccess) sit nicely under your root. Lib contains everything else, which again seems nice. However, the functions within your framework may use php to dish up html pages. In this case, would they not need reference images and js? If they do, what would you say is the best way to specify the path to these items? In your example above, if you had a function called myfunction.php, which resided in your “MyFramework” directory, and it wanted to reference myimage.gif in your img directory, would you do something like this: <img src="../imgs/myimage.gif" Title="myimage" alt="myimage" /> Also, you mention the include_path. I have looked around for this, but am not 100% with it yet. Here are my questions: Is the purpose of include_path to store one or many paths? Is it only there to support “includes” (or requires)? Why would I use this if I can use relative paths in my code (re-use????)? To what extent is any of this platform specific? If portions ARE platform specific, are there ways to alter it to run across platforms? Thanks again, S
×
×
  • 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.