Re: [PHP] url string being split
On Thu, Apr 26, 2012 at 12:58 PM, Stuart Dallas stu...@3ft9.com wrote: On 26 Apr 2012, at 18:37, Jim Giner wrote: Im no expert, but why would you expose a query to the world thru the use of a GET? Why not just collect the params and build the string in your code? That is how people hack into your database - via a re-formed query. You're giving someone an open invitation. A query string has nothing to do with databases. -Stuart I still haven't been able to find a solution. Is there anyone out there that knows how to keep the query string intact? Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] url string being split
On Fri, Apr 27, 2012 at 11:09 AM, Shawn McKenzie nos...@mckenzies.net wrote: On 04/27/2012 10:56 AM, Chris Stinemetz wrote: I still haven't been able to find a solution. Is there anyone out there that knows how to keep the query string intact? Thank you, Chris urlencode($storerow['store_subject']) -- Thanks! -Shawn http://www.spidean.com Thank you. That is what I was looking for. -Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] url string being split
Hello list, I'm trying to pass a query string through $_GET but for some reason the array is being split on ''. How may I avoid this so it stays intacted? user selection portion: while($storerow = mysql_fetch_assoc($storesresult)) echo 'h4a href=store.php?id=' . $storerow['store_subject'] . '' . $storerow['store_subject'] . '/a/h4 at ' . date('m-d-Y h:i:s A', strtotime($storerow['real_time_date'])); produces url string: http://westeng/forum/store.php?id=Wiser Communication, LLC - - Sprague Ave print(pre.print_r($_GET,true)./pre); ## results below Array ( [id] = Wiser Communication, LLC - [-_Sprague_Ave] = ) How do I make it so the string isn't split into two elements in the array? I want it to stay instact. Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL table design
Hello List, Is it possible to create a MySQL table with characters such as . and [] in the column headers? If so would you explain how? Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL table design
On Thu, Mar 22, 2012 at 7:42 PM, Stuart Dallas stu...@3ft9.com wrote: On 23 Mar 2012, at 00:10, Chris Stinemetz wrote: Is it possible to create a MySQL table with characters such as . and [] in the column headers? If so would you explain how? Try putting the column names in backticks (`). BUT... whatever the reason why you want to do that, IT'S WRONG. Seriously, don't do it. It will cause you more problems than you think it will solve, and I don't even know what problem you think it will solve. I am just trying to preserve the source headers from the original data I want to import into the table. Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dev to production server
By local, do you mean a local dedicated box, or an everyday use box? It is an everyday use box. The checklist varies quite a bit depending on the results. Also, is your site to be served by standard port 80 traffic? Does your Internet host allow inbound port 80? Yes it will be served by standard port 80 traffic and yes my Internet host allows inbound port 80. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dev to production server
On Wed, Sep 7, 2011 at 6:23 AM, James Yerge ja...@nixsecurity.org wrote: On 09/07/2011 12:24 AM, Chris Stinemetz wrote: Does anyone have a procedure or know of any tutorials that explain how to take a mac/apache/php/mysql dev environment and converting it to production environment? Basically I want to host my own web site on my local machine now that I have finished developing it. Thanks in advance! I'm not familiar with MAC, however, there are projects out there that provide everything you need, for the most part. Look up XAMPP, I used to use this in the past before I setup my own personal server. http://www.apachefriends.org/en/xampp-macosx.html This should provide you with an environment necessary for development and production. I currently run Arch Linux on my personal server and have installed Apache, PHP, MySQL and so on via the package manager. For my dev/prod process, I'm using Boilerplate, which provides a default HTML5/CSS3 template. However, the nice thing about it is, they've also provided a small build process using ANT. I've modified the ANT build script to my needs and simply build my production environment using that, keeping my dev code in tact and readable :) They've integrated the YUI Compressor into their build process is simply minifies all CSS and JavaScript. Anyway, enough about that, just an example of what can be done. There's always the option of compiling everything from source as well :) James Thank you James. I appreciate your advise. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dev to production server
Does anyone have a procedure or know of any tutorials that explain how to take a mac/apache/php/mysql dev environment and converting it to production environment? Basically I want to host my own web site on my local machine now that I have finished developing it. Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dealing with multiple form submissions
On Aug 24, 2011, at 3:46 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Mike Mackintosh mike.mackint...@angrystatic.com wrote: On Aug 24, 2011, at 11:52, John Black s...@network-technologies.org wrote: On 08/24/2011 03:04 AM, Jason Pruim wrote: Wondering what everyone does to prevent multiple form submissions? My form is simply getting emailed to my email, and it redirects to a success page when submitted... Would it be as simple as doing something with the cache control? Basically I'm trying to avoid someone submitting a form... Then hitting back, and submitting again, then hitting back I think you get the idea... What do you all do? Jason Pruim Hi, I am using $_SESSION for this. Set a value on the initial page, a timestamp is a good choice, then validate the value on the receiving script and clear the value. I like to use a timestamp because it will allow you to deny a comment which took too long to submit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I've always tended to stay away from session for that, as when the browser closes/restarts, the page is accessible again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I solved this issue with timestamps stored in the db with the submission. With each submission, I took all the info that should make it uniqueish, and checked if it was near another one. A time limit of 10th seconds worked out well. The reason I had the problem was because we were triggering a counter on an account from get data (which the browser can request in a way that looks like multiple submissions). We should have used post, which didn't have this problem though really. Will you please show an example of using this timestamp methodology? Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chained select with ajax
I was able to figure it out. Discovered the very useful tool firebug! Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form validation
I have a select menu created by a foreach loop. I am trying to validate that there was a selection made before it is submitted to the database. But I am not doing something correctly. select name=market class=ajax onchange=javascript:get(this.parentNode); option value=Choose.../option ?php foreach($market_prefix as $key = $value) { $selected = ''; if($value == $market) { $selected = 'selected'; } echo 'option value=', htmlspecialchars($value), ' ', $selected, '', htmlspecialchars($market_name[$key]), '/option'; } ? /select I am using the folling on the posted page. if (! array_key_exists($_POST['market'], $market_name)) { echo You did not select a market.; } Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form handling
I have two forms on the same php script. Is it possible to submit both forms to the same action=processform.php with a single submit button? If so would you give me examples on how to handle this? I will also continue searching google. Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form handling
If the two forms call the same script that's fine. If not, that will work too. Just realize that the inputs from one form will NOT be returned to the script when the submit is used from the other form. Jim, This is what I am trying to do. One submit button for both forms going to the same destination. The only reason I am doing this is because I can't figure out why my ajax for my select menus is altering my tinyMCE textarea box. Ultimately if I can figure out how to control the ajax within the div container as I showed in a previous email I would be able to just use one form. any ideas?? Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form handling
Chris, By definition, a 'submit' button submits a form. Not 2 forms. Each form has to have it's own form. It is not feasible to submit two forms - since the conversation from your client pc is going to be garbled even if you could (JS?) do the second submit. One transactiion is going to answer your client and then the other is going to wipe it out with its respone. I don't think you have ot separate your forms becuase they are in separate divs. I could be wrong - never tried it. I didn't think it was possible either. I will play around with the div container and ajax some more tonight. Hope I will be able to figure it out. Is it possible to place a div within the form to only affect the select tags? Thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form handling
I would bet it's the quotes screwing up the js. Can / are you escaping that variable when ajaxing it back? Bastien Koert 905-904-0334 I found a way to make the ajax work with one form. I removed the table and the ajax worked just fine. Aparently you can't embed div containers within a table without affecting the whole table. At least that is what I found out tonight. Please correct me if I am wrong. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text insertion
How do I preserve text formatting when text is inserted into a database table? For example: I am using a textarea to allow users to leave comments into the database and I am using: ' . mysql_real_escape_string($_POST['store_comments']) . ', to prevent SQL injection; But when I call the data with php from the database the format it was inserted is not preserved. Is there a way to make sure when a user adds new paragraphs or indentation it will be preserved? Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
Are you sure its not preserved? When you output text in a browser, by default its output as html, not plain text. Html ignores extraneous whitespace, and doesn't use a monospaced font, so formatting text into columns in a textarea won't work either. Look at the html source code to see what is actually being output. Thanks Ashley Source is showing indentation and new paragaraphs just as I inserted the text. How can I get HTML output to show same format? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
Use HTML 'pre' tags: pre?php echo $your_content; ?/pre I just tried that and that puts all the text on a single line. echo 'tr class=topic-post td class=user-poststrong' . $posts_row['first_name'] . ' ' . $posts_row['last_name'] . ' ' . date('m-d-Y h:iA', strtotime($posts_row['store_date'])) . '/strong/td /tr tr class=visit td class=post-contentBroad Band test results:/strong ' . $posts_row['store_tptest'] . 'br/br/pre' .$posts_row['store_comments'] . '/pre/td /tr'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
No luck. Thanks. On Aug 10, 2011 4:17 PM, hdede...@videotron.ca wrote: how about echo nl2br($your_content); - Original Message - From: Chris Stinemetz chrisstinem...@gmail.com Date: Wednesday, August 10, 2011 5:09 pm Subject: Re: [PHP] text insertion To: Daniel P. Brown daniel.br...@parasane.net Cc: Ashley Sheridan a...@ashleysheridan.co.uk, PHP General php-general@lists.php.net Use HTML 'pre' tags: pre?php echo $your_content; ?/pre I just tried that and that puts all the text on a single line. echo 'tr class=topic-post td class=user-poststrong' . $posts_row['first_name'] . ' ' . $posts_row['last_name'] . ' ' . date('m-d-Y h:iA', strtotime($posts_row['store_date'])) . '/strong/td /tr tr class=visit td class=post-contentBroad Band test results:/strong ' . $posts_row['store_tptest'] . 'br/br/pre' .$posts_row['store_comments'] . '/pre/td /tr'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with inserting numbers...
basically all I'm trying to do is generate the last 4 digits starting at and going up to . for testing purposes I'm just echoing back but will eventually insert the complete number back into the database as a 7 digit string. The error I'm getting is: Fatal error: Maximum execution time of 30 seconds exceeded in /home/pruimpho/public_html/jason/dev/clients/flewid/Phone/config/phoneareacodes.php on line25 I'm not sure the to while loops is the best control structure. Why not try the following and see if it gets you the results you want? __untested__ while($row = mysql_fetch_assoc($result)) { if ($num != 1) $padnum = number_pad($num, 4) { echo $row['areacode'] . - . $row['prefix'] . - . $padnum . BR; $num++; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] concatenating
Is it possible to concatenate a string and an element from a mysql_fetch_assoc array? I haven't had much luck searching google. Such as concatenating results with ' . $posts_row['store_tptest'] . ' so that if there are no elements returned nothing will be displayed? Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pass text variables to next page
Thank you Tamara. Not sure if I am doing it right. It looks like the last single quote is being escaped. When I dump the query I get: SELECT store_id, store_subject FROM stores WHERE store_subject = 'Bella Roe 4980 Roe Blvd\' I am thinking maybe I have too many single quotes some where, but I can't find it. echo 'h4a href=store.php?id=' . $storerow['store_subject'] . '' . $storerow['store_subject'] . '/a/h4 at ' . date('m-d-Y', strtotime($storerow['store_date'])); The query: $sql = SELECT store_id, store_subject FROM stores WHERE store_subject = ' . mysql_real_escape_string($_GET['id'].'); Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form hidden value
I'm trying to pass a hidden value with my form submission. Not sure what I am doing woring, but the value is not being passed. Query is___ $query = SELECT id, store_name FROM store_list WHERE store_type = '$type' AND id_market = '$market' ; $result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__)); while($row = mysql_fetch_array($result)) { $store_name[] = $row['store_name']; $id[] = $row['id']; } sort($store_name); } Form portion is input type=hidden name=id value=?php echo '$id[]';? Any help is greatly appreciated. Thank you.
[PHP] pass text variables to next page
I am trying to pass text strings from on page to a next to populate the queries on the passed to page. The only way I can get the query to work is if I am able to put single ticks around the string to make it literal, but I can't seem to figure out how to do it for the following line of code. echo 'h3a href=store.php?id=' . $row['store_name'] . '' . $row['store_name'] . '/abr /h3' . $row['store_type']; When i do a dump the query and print(pre.print_r($_GET,true)./pre); I get the following respectively: SELECT store_id, store_subject FROM stores WHERE store_subject = Loma Vista 8712 Blue Ridge BlvdThe topic could not be displayed, please try again later.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Vista 8712 Blue Ridge Blvd' at line 3 The PHP code for the query is: Array ( [id] = Loma Vista 8712 Blue Ridge Blvd ) $sql = SELECT store_id, store_subject FROM stores WHERE store_subject = . mysql_real_escape_string($_GET['id']); The query works fine When I run the command in console and place '' around Loma Vista 8712 Blue Ridge Blvd Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] control structure
// This part makes no sense they are not logged in and they have a level of 1 or 2 ? Yes. It might not be the best approach, but I am assigning the user a value: 1, 2, or 3 while they create an account. This will limit what they will be able to post. For example I only want users with user level of 1 or 2 to be able to complete the form in this script. Hence, the control structure I am trying to include. // And you was missing a Pipe after false. It will cause the If statement to fail. Thanks for pointing this out. I quess I have been staring at the computer way too long! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP frameworks
Hello all, I am thinking about venturing into PHP frameworks, but I would like to get advice on what the correct selection would be for someone that is about intermediate in PHP knowledge. Thank you, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] default option
Hello, I am building some select menu's dynamically from a mysql database and am courous how to give the menu a default option Choose. Below is what I have so far for one of my menu's. Thank you in advace. select name=market id=market onchange=javascript:get(this.parentNode); ?php foreach($market_prefix as $key = $value) { $selected = ''; if($value == $market) { $selected = 'selected'; } echo(option value=$value $selected $value : $market_name[$key]); } ? /select -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] default option
Thank you Stuart. That did the trick. On Mon, Jul 18, 2011 at 10:38 PM, Stuart Dallas stu...@3ft9.com wrote: On Tue, Jul 19, 2011 at 4:28 AM, Chris Stinemetz chrisstinem...@gmail.com wrote: Hello, I am building some select menu's dynamically from a mysql database and am courous how to give the menu a default option Choose. Below is what I have so far for one of my menu's. Thank you in advace. select name=market id=market onchange=javascript:get(this.parentNode); ?php foreach($market_prefix as $key = $value) { $selected = ''; if($value == $market) { $selected = 'selected'; } echo(option value=$value $selected $value : $market_name[$key]); } ? /select Just add it as the first option. If none of the options have the selected attribute, the first option will be the selected one. I'd also recommend you escape the variables you're outputting, on the off chance they contain HTML-like code. select name=market id=market onchange=if (this.value != '') { javascript:get(this.parentNode); } option value=Choose.../option ?php foreach($market_prefix as $key = $value) { $selected = ''; if ($value == $market) { $selected = 'selected'; } echo 'option value=', htmlspecialchars($value), ' ', $selected, '', htmlspecialchars($value.' : '.$market_name[$key]), '/option'; } ? /select -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] chained select with ajax
This is a [Cross-post] I didn't receive any feedback from phpdb list. Hope fully there is someone out there that may offer some advice why my code isn't working correctly. Thanks all. I am trying to create a cascading seletct with 3 menu choices. For some reason my third select menu is not populating. It doesn't seem like my ajax is correctly sending $_post values to the final query in my PHP class I built. By the time I make it to the final third select menu there are no choices. Hopefully someone can find something I missed in the following code snippits. Any help is greatly appreciated. Please excuse the incorrect indentions. For some reason gmail changes it. Thanks, Chris ajax code... script $(document).ready(function(){ $(select#type).attr(disabled,disabled); $(select#store).attr(disabled,disabled); $(select#market).change(function(){ $(select#type).attr(disabled,disabled); $(select#type).html(optionplease wait.../option); var id = $(select#market option:selected).attr('value'); $.post(select_type.php, {id:id}, function(data){ $(select#type).removeAttr(disabled); $(select#type).html(data); }); }); $(select#type).change(function(){ $(select#store).attr(disabled,disabled); $(select#store).html(optionplease wait.../option); var id = $(select#type option:selected).attr('value'); $.post(select_store.php, {id:id}, function(data){ $(select#store).removeAttr(disabled); $(select#store).html(data); }); }); $(form#select_form).submit(function(){ var market = $(select#market option:selected).attr('value'); var type = $(select#type option:selected).attr('value'); var store = $(select#store option:selected).attr('value'); if(market0 type0 store0) { var market = $(select#market option:selected).html(); var type = $(select#type option:selected).html(); var store = $(select#store option:selected).html(); $(#result).html('your choices were: '+market +' , '+type +' and '+store); } else { $(#result).html(you must choose three options!); } return false; }); }); /script php class for populating select menus ?php class SelectList { protected $conn; public function __construct() { $this-DbConnect(); } protected function DbConnect() { include db_config.php; $this-conn = mysql_connect($host,$user,$password) OR die(Unable to connect to the database); mysql_select_db($db,$this-conn) OR die(can not select the database $db); return TRUE; } public function ShowMarket() { $sql = SELECT DISTINCT id_markets FROM store_list; $res = mysql_query($sql,$this-conn); $market = 'option value=0market.../option'; while($row = mysql_fetch_array($res)) { $market .= 'option value=' . $row['id'] . '' . $row['id_markets'] . '/option'; } return $market; } public function ShowType() { $sql = SELECT DISTINCT store_type FROM store_list; $res = mysql_query($sql,$this-conn); $type = 'option value=0store type.../option'; while($row = mysql_fetch_array($res)) { $type .= 'option value=' . $row['id'] . '' . $row['store_type'] . '/option'; } return $type; } public function ShowStore() { $sql = SELECT store_name FROM store_list WHERE id_markets=$_POST[id] AND store_type=$_POST[id]; $res = mysql_query($sql,$this-conn); $Store = 'option value=0stores.../option'; while($row = mysql_fetch_array($res)) { $Store .= 'option value=' . $row['id'] . '' . $row['store_name'] . '/option'; } return $Store; } } $opt = new SelectList(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A Question On Web Graphics
Also I have successfully experimented with Apache and PHP but have not yet identified graphics applications for this venue either! Ideas? You may want to look into PHP:GD link to manual: http://php.net/manual/en/book.image.php HTH, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP control structure
Hey all, I would like to add an if statement to the following function so that the value 1 is assigned corporate and the value is 2 assign standard to it. Would you show me an example on adding it to the below function? If there is a better way to reassign the value please share. Thank you, Chris public function ShowType() { $sql = SELECT DISTINCT store_type FROM store_list WHERE id_markets=$_POST[id]; $res = mysql_query($sql,$this-conn); $Type = 'option value=0store type.../option'; while($row = mysql_fetch_array($res)) { $Type .= 'option value=' . $row['id_store'] . '' . $row['store_type'] . '/option'; } return $Type; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linking A C Program Example to PHP
On Sun, Jul 10, 2011 at 4:56 PM, Thomas Dineen tdin...@ix.netcom.com wrote: Gentle People: Please Help! I am attempting to link a C Program example to PHP using the tutorial shown at the link below: http://voloreport.com/making-a-c-extension-for-php-in-11-easy-steps Everything worked fine up through step 9 in the tutorial: Now the problem: The example works fine from the command line with either of the commands shown below: php test.php php -c /etc/apache2/php.ini test.php But the example will NOT work via the web browser on my Apache 2 (2.2.17) / PHP (5.3.5) Web Server! Have you looked into apache error log? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] Installing PHP
Jim, What is your server root set up too? I would put the apache configuration back to the way it was and then place php script with phpinfo() function in it. Try to run it and see if that works. HTH, Chris On Jul 4, 2011 8:14 AM, Alejandro Michelin Salomon (Hotmail) amichel...@hotmail.com wrote: Jim: In my Windows the install adds the lines : #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir C:\PHP\ LoadModule php5_module C:\PHP\php5apache2_2.dll AddHandler application/x-httpd-php .php #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL Where is the apache version that you install? I have the apache 2.2.17 This php5apache2.dll is for the version 2.0.x And this php5apache2_2.dll for the version 2.2.x Maybe the dll files is in the brong version. Alejandro M.S. -Mensagem original- De: Jim Giner [mailto:jim.gi...@albanyhandball.com] Enviada em: segunda-feira, 4 de julho de 2011 09:40 Para: php-general@lists.php.net Assunto: [PHP] Installing PHP Hi all, (Hopefully I posted this in a place that can/will help me) I got curious about running php / apache on my own laptop in order to help my devl process, instead of writing, uploading and testing on my site. Found a nice pair of docs from thesitewizard.com that appeared to be pretty well-written instructions on installing each of these systems. btw- I'm running XpSp2. Chose the Apache 2.0 and PHP 5.2 (thread-safe?) per the recommendations. Went thru all instructions step-by-step, testing all the way. Apache works - PHP doesn't. When I bring up IE and type in localhost I get the default apache page as I was told I should see. When I type localhost/test.php I get a windows dialog asking what program should run the php script. In debugging I went to a cmd windows and ran c:\php\php-cgi test.php and got the expected result from my script - so PHP works. End result - they each work separately, but php is not working under apache. As part of the docs instructions I added the following code to the apache conf file: 1 - I chose the configure apache to run php as an apache module. 2 - added LoadModule php5_module c:/php/php5apache2.dll as last one of those lines 3 - added AddType application/x-httpd-php .php as the last of those lines 4 - added PHPIniDir c:/php as the last line of the conf file. Upon adding these lines apache will no longer restart. In fact adding any ONE of these lines breaks Apache. Ideas welcome. And for those who still love the USofA, Happy Independence Day! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Installing PHP
What is your document root set to in your httpd.conf file? By default it should be htdocs subdirectory in apache program files. Sent from my iPod On Jul 4, 2011, at 12:10 PM, Jim Giner jim.gi...@albanyhandball.com wrote: Shawn, I added my php folder to the path but no change. Shawn McKenzie nos...@mckenzies.net wrote in message news:4e11e7e7.6010...@mckenzies.net... You may need to add c:\php\ to the Windows path so that the Apache mod can find other files it may need. If you have mysql or other extensions enabled in php.ini, then they may be looking for another dll that is located in the php dir. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Installing PHP
On Mon, Jul 4, 2011 at 8:13 AM, Alejandro Michelin Salomon (Hotmail) amichel...@hotmail.com wrote: Jim: In my Windows the install adds the lines : #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir C:\PHP\ LoadModule php5_module C:\PHP\php5apache2_2.dll AddHandler application/x-httpd-php .php #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL Where is the apache version that you install? I have the apache 2.2.17 This php5apache2.dll is for the version 2.0.x And this php5apache2_2.dll for the version 2.2.x Maybe the dll files is in the brong version. Alejandro M.S. Jim, Alejandro makes a valid point. There is a naming convention change from apache 2.0. to 2.2 for the dll file. I know in your original post you specified that you loaded 2.0, but you may want to double check. Since 2.2 requires php5apache2_2.dll to work correctly. Just a thought, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Re: radio form submission
That worked perfectly! Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Re: radio form submission
radio select validation What I am doing wrong? I want to make sure a radio button is selected, but my current code allows insertion even when radio button isn't selected. My code is: //Generating radio buttons for store type with array echo 'Store type:br /br /'; $choices = array('corporate' = 'Cricket owned | ', 'premier' = 'Premier dealer'); foreach ($choices as $key = $choice) { echo input type='radio' name='store_type' value='$key'/ $choice \n; } //Validate the radio button submission if (!array_key_exists($_POST['store_type'], $choices)) { echo You must select a valid choice.; } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php hide menu
If you do require the value from the first menu to be passed to the select statements for the other menus let me know I will explain how that is done, it is a little more complex. I would like to pass the value from the prior menu to the next. Would you please show me how to handle this? Thank you, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php hide menu
I have three drop down menus in my form. How do I make it so the second and third menus are only visible once the prior menu was selected? Below is the first two drop down menus. Thanks in advance. // Generating first menu using array. $markets = array('MCI' = 'Kansas City', 'STL' = 'ST. Louis', 'ICT' = 'Wichita', 'OMA' = 'Omaha', 'LIN' = 'Lincoln'); echo select name='term'option value=''Choose Market/option\n; foreach ($markets as $key = $market) { echo option value='$key'$market/option\n; } echo /select; // This will evaluate to TRUE so the text will be printed. if (isset($markets)) { echo This var is set so I will print.; } // Then, later, validating the menu if (! array_key_exists($_POST['Market'], $choices)) { echo You must select a market.; } $query=SELECT cell_sect FROM sector_list order by cell_sect; $result = mysql_query ($query); echo select name='cat'option value=''Choose Cell Sector/option; // printing the list box select command while($cellSect=mysql_fetch_array($result)){//Array or records stored in $cellSect echo option value=$cellSect[cell_sect]$cellSect[cell_sect]/option; /* Option values are added by looping through the array */ } echo /select;// Closing of list box // This will evaluate to TRUE so the text will be printed. if (isset($cellSect)) { echo This var is set so I will print.; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP delete confirmation
I have been trying to figure out how to add delete confirmation for the bellow snippet of code. I would prefer not to use javascript. Can anyone offer any advise on how to right the delete confirmation in PHP? Thank you in advance. P.S. I apologize for the indention. For some reason gmail messes it up. ?php // loop through results of database query, displaying them in the table while($row = mysql_fetch_array( $result )) { // echo out the contents of each row into a table echo tr; echo 'td' . $row['Name'] . '/td'; echo 'td' . $row['Date'] . '/td'; echo 'td' . $row['StoreInfo'] . '/td'; echo 'td' . $row['Address'] . '/td'; echo 'td' . $row['Type'] . '/td'; echo 'td' . $row['EngTech'] . '/td'; echo 'td' . $row['StoreManager'] . '/td'; echo 'td' . $row['BBtime'] . '/td'; echo 'td' . $row['BBup'] . '/td'; echo 'td' . $row['BBdown'] . '/td'; echo 'td' . $row['SiteSect'] . '/td'; echo 'td' . $row['VoiceCall'] . '/td'; echo 'td' . $row['Comments'] . '/td'; echo 'tda href=edit.php?id=' . $row['id'] .'Edit/a/td'; echo 'tda href=delete.php?id=' . $row['id'] .'Delete/a/td'; echo /tr; } // close table echo /table; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php