Jump to content

ibuprofen

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

About ibuprofen

  • Birthday 07/19/1969

Profile Information

  • Gender
    Male
  • Location
    Dallas, TX

Contact Methods

  • Yahoo
    tom_is_there

ibuprofen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is embarrassing but I figured it out. I updated the framework from 1.11.0 to 1.11.2. Problem fixed. So, the solution is: any ZF prior to 1.11.2 won't work with Snow Leopard. There it is.
  2. I'm done with Zend, this is the third time I've messed with it and never even achieved a successful install. What makes me mad is how easy it's •supposed• to be. It's only easy if you're already an expert. I'm an end user, not a programmer. Growl.
  3. Before I get too frustrated I'm going to dig out my old laptop with OS 10.3 and see if it works on that. If so, I'll know I was defeated before I ever got started.
  4. To follow up on my own post, this is what I'm doing. The book I have says to move the contents of the /library to a path inside my include_path list which is: .:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/lib:/usr/lib/php The contents of the /library folder are a single folder called Zend. So, I moved this to /usr/lib/php, restart Apache and still receive the error in my previous post when I type zf in terminal. Every time I try to install Zend I run into a problem I have not the skills to solve.
  5. After making sure I had the correct php.ini file using phpinfo(), I opened it and inserted the path to the framework library, restarted apache and verified the new include_path was loaded via phpinfo(). Below is my include_path. I'll move the library somewhere else when I can finally get this to work. The error says I need to tell the command line tool where to find the library and as far as I know I've done that. No dice. Any ideas? include_path = ".:/Library/WebServer/Documents/var/www/ZendFramework/library:/usr/lib/php:/usr/local/lib/php" When I type zf in Terminal, this is the error: ***************************** ZF ERROR ******************************** In order to run the zf command, you need to ensure that Zend Framework is inside your include_path. There are a variety of ways that you can ensure that this zf command line tool knows where the Zend Framework library is on your system, but not all of them can be described here. The easiest way to get the zf command running is to give it the include path via an environment variable ZEND_TOOL_INCLUDE_PATH or ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use, then run the command "zf --setup". This command is designed to create a storage location for your user, as well as create the zf.ini file that the zf command will consult in order to run properly on your system. Example you would run: $ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup Your are encourged to read more in the link that follows. Zend_Tool & CLI Setup Information (available via the command line "zf --info") * Home directory found in environment variable HOME with value /Users/myHome * Storage directory assumed in home directory at location /Users/myHome/.zf/ * Storage directory does not exist at /Users/myHome/.zf/ * Config file assumed in home directory at location /Users/myHome/.zf.ini * Config file does not exist at /Users/myHome/.zf.ini ****************************************************************
  6. The code below is a function that checks to see if an email address exists in a database, if so it alerts the user. The db has one table and one field. It works fine when there is ONE record! However, if there are > 1 it doesn't work. How can I step through each record and compare it to what the user entered? Of course, $_POST is the user's value and the db record is the $myAddy value. <?php function emailLookup() { include ('file:///Library/WebServer/Documents/re_connect_scripts/emailLookup.php'); while ($row = mysqli_fetch_array($result)) { extract ($row); $myAddy = $addy; } if ($_POST["add_email"] == $myAddy) { global $lookupError; $lookupError = 'This email address is already on the list.'; global $counter; $counter++; } else { return; } } ?>
  7. From the videos I watched on the Zend site I understand the MVC concept although I don't think model-view-controller are the most appropriate descriptive terms. Since I've been developing PHP I have unwittingly created my own framework in that respect. I call mine: dbConnectScripts, phpAndHTML and specialScriptsAndFunctions. I see no need to separate the PHP from the HTML, at least not for what I'm doing. Also, it seems like using a framework will create lots more files. That is something I actually strive to avoid. I annotate all my PHP scripts to avoid that. More files is something I DO NOT want. However, if using a framework is really as beneficial as they say, I should probably be willing to learn and use one. The question I can't seem to figure out is exactly how does using Zend or any other framework help me write better or faster code? My experience has been just that, the more I develop, the easier it gets. I created a small library with snippets I constantly copy and paste so I don't have to rewrite them. I also borrow heavily from existing scripts I wrote from scratch. The more I develop, the more resources I create for myself. I have read a book and watched more online videos but they're assuming I'm a formally trained programmer. They get into all this obscure (at least to me) programmer talk and lose me pretty fast. I guess I don't understand how it's implemented and I haven't been able to find a plain English or real world example. I'm beginning to suspect this has been done on purpose. Anyone else feel my pain? Tom
  8. I tried addslashes(), no luck. I've come to the conclusion textboxes in PHP are not compatible with both apostrophes and double quotes. It must be one or the other.
  9. When creating sticky forms, I can get one textfield to work with apostrophes and another to work with double quotes, but neither of them works with both. Below is the script I wrote to illustrate the problem. The first script is the form, the second script echos the output on another page. The output page just links back to the first at which time the problem occurs. Any ideas on how to get a field to accept both apostrophes and double quotes? ----------------------------- First script: ----------------------------- <body> Sticky Forms: <form action="materialPreview2.php" method="post" name="enterName" target="_self" id="enterName"> <p>This will retain double quotes, but NOT apostrophes. Try it: <input name="firstTextField" type="text" value='<?php echo @$_POST['firstTextField']; ?>'> </p> <p>This will retain apostrophes, but NOT double quotes. Try it: <input name="secondTextField" type="text" value="<?php echo @$_POST['secondTextField']; ?>"> </p> <p> <input name="insert" type="submit" id="insert" value=" Insert "> </p> </form> </body> ----------------------------- Second script: ----------------------------- <body> <?php $myVar = $_POST["firstTextField"]; $myVar2 = $_POST["secondTextField"]; echo "Is " . $myVar . " and " . $myVar2 . " really what you want to stick?"; echo "<br>"; ?> <form name="form1" method="post" action="materialInput2.php"> <input type="hidden" name="firstTextField" value='<?php echo $myVar; ?>'> <input type="hidden" name="secondTextField" value="<?php echo $myVar2; ?>"> <input type="submit" name="button2" id="button2" value=" Edit "> </form> </body>
  10. I added the line in blue to the database connect script and I don't have a problem with apostrophes anymore, but I still can't use double quotes or other special characters. Drat. BTW: I have Magic Quotes turned off. $host = "REMOVED"; $user = "REMOVED"; $password = "REMOVED"; $database = "materials"; $cxn = mysqli_connect($host,$user,$password,$database) or die ("Cannot connect to $database, see system administrator."); $var36 = mysqli_real_escape_string($cxn, trim($_GET['var6'])); if ($updateScript == 'ttp') { $query = "UPDATE thermal_transfer_paper SET category='TTP', material='$var36', WHERE supplierItemNo = '$whichRecord'"; $result = mysqli_query($cxn,$query) or die ("Could not execute query, see system administrator."); } Thanks for the pointer, Thomas
  11. I've seen lots of tutorials on the mysqli_real_escape_string(), but they all assume you're inputting directly from a form to the database using the $_POST method. On my site I'm displaying the user input on a verification page before submitting it. After the user proofs the input, they hit "Submit" and it goes to a confirmation page. The confirmation page connects to the database like this: { $updateScript = 'ttp'; include ('file:///Library/WebServer/Documents/connectScript/updateScripts.php'); } Here is the query used to add the record from the "updateScripts.php" document: $host = "REMOVED"; $user = "REMOVED"; $password = "REMOVED"; $database = "materials"; $cxn = mysqli_connect($host,$user,$password,$database) or die ("Cannot connect to $database, see system administrator."); if ($updateScript == 'ttp') { $query = "UPDATE thermal_transfer_paper SET category='TTP', material='$_GET[var14]', supplier='$_GET[var15]',supplierItemNo='$_GET[var1]',pricingClass='$_GET[var16]', msi_to_49='$_GET[var2]',msi_to_49c='$_GET[var3]',msi_over_49='$_GET[var4]', msi_over_49c='$_GET[var5]',description='$_GET[var6]',notes='$_GET[var7]',matThick='$_GET[var8]', linerThick='$_GET[var9]',unit='$_GET[var13]',linerType='$_GET[var17]',needsRetool='$_GET[var11]', baseMat='$_GET[var10]',ULComp='$_GET[var12]', matUnit='$_GET[var25]' WHERE supplierItemNo = '$whichRecord'"; $result = mysqli_query($cxn,$query) or die ("Could not execute query, see system administrator."); } Where do I use the mysqli_real_escape_string? I've tried several ways but I always get errors. Thomas
  12. Hi all, this is my first post. Glad to be here and I'm looking forward to contributing any way I can. Here's my situation: 1) A user enters info in an HTML form and they submit. 2) A preview page displays the entered values with the option to submit or edit. 3) If they need to edit, the original form loads with their original info retained, no problem. However, I cannot figure out how to clear the form should they want to start over. The regular HTML reset-form doesn't work nor does a Javascript reset-form. The values PHP inserts are overriding everything. Any ideas? Thomas
×
×
  • 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.