Jump to content

jmurch

Members
  • Posts

    82
  • Joined

  • Last visited

Everything posted by jmurch

  1. I'm using this while to loop thru my array: while ($row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS)) { It's leaving the last row unprocessed each time. How can I modify the above statement to loop one extra time after the normal count? TIA, Jeff
  2. I'm using this while to loop thru my array: while ($row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS)) { It's leaving the last row unprocessed each time. How can I modify the above statement to loop one extra time? TIA, Jeff
  3. Does the other site receive the data POST or GET? If it's GET put it in the URL. If it POST put the URL of the other site in the form action. Jeff
  4. I have a date in the format '06-AUG-99'. I need to display a date 90 days in the future and 13 months in the future. The date is coming from a text field in an RMS database (pre-relational) so I would guess that the characters need to be converted to a date format that PHP will like. TIA, Jeff
  5. Solved this but I'd still like to know why. I modified the search_text to have 3 one for each keyword and it works fine. Can anyone explain why? TIA mysql_query("SELECT cat1, cat2, part, description, price, concat(parts_list.cat1,' ',parts_list.cat2,' ', parts_list.part,' ', parts_list.description) as 'search_text', concat(parts_list.cat1,' ',parts_list.cat2,' ', parts_list.part,' ', parts_list.description) as 'search_text2', concat(parts_list.cat1,' ',parts_list.cat2,' ', parts_list.part,' ', parts_list.description) as 'search_text3' from parts_list having ((search_text like '%$keyword1%') and (search_text2 like '%$keyword2%') and (search_text3 like '%$keyword3%')) LIMIT 4000");
  6. mikesta707, I need to match all three keywords which is why I have the wildcards if there is only one (or two) keyword(s).
  7. I cannot figure this out. I have a single text box ($keyword) that submits up to 3 keywords to search multiple columns. I explode, populate $keyword1, 2, and 3 with either array values or wildcards and run the query. What is happening is the query always runs with $keyword1 populated but when $keyword2 or 3 has a value the query won't return any values even though running it in a query browser works. The query does run fine however when $keyword2 or 3 have static values entered in the query......... TIA $keyword_value = $keyword; $keyword_array = explode(' ',$keyword_value); if(sizeof($keyword_array) == 1) { reset($keyword_array); $keyword1 = $keyword_array[0]; $keyword2 = "%"; $keyword3 = "%"; }elseif(sizeof($keyword_array) == 2) { reset($keyword_array); $keyword1 = $keyword_array[0]; $keyword2 = $keyword_array[1]; $keyword3 = "%"; }elseif(sizeof($keyword_array) == 3) { reset($keyword_array); $keyword1 = $keyword_array[0]; $keyword2 = $keyword_array[1]; $keyword3 = $keyword_array[2]; } $get_parts_query = mysql_query("SELECT cat1, cat2, part, description, price, concat(parts_list.cat1,' ',parts_list.cat2,' ', parts_list.part,' ', parts_list.description) as 'search_text' from parts_list having ((search_text like '%$keyword1%') and (search_text like '%$keyword2%') and (search_text like '%$keyword3%')) LIMIT 400");
  8. I am trying to match a string that contains (anywhere in the string): '/var/iso/*.pdf' I have tried many different combinations with no luck yet. TIA, Jeff
  9. I have an a multi array that contains values that I must evaluate before continuing. If the value of the sub-array contains '/path1/*.pdf' I will proceed. If the value contains 'path1/path2/*.pdf' I will throw it out and proceed to the next sub-array key. What is the best practices for this? I've tried array_filter, in_array, etc. The code that I've been working with is: while(list($key, $value) = each($qry_results)) { while(list($key1, $value1) = each($value)) { if($key1 == "url") { //////// attemempting filters here//////// reset($value); while(list($key1, $value1) = each($value)) { echo "<b>$key1</b> "; echo "$value1<br>"; } } } echo "<br><br>"; } TIA, Jeff edit by ober to improve formatting.
  10. It was the post headers that were causing the problem. Thanks.
  11. I had my hopes up redarrow but that made no difference. I tried it on two sites one with mod_sec and one without. Jeff
  12. How about: select * from table where name = $name OR class = $class OR gender = $gender order by $sorting method
  13. I have a small curl script that logs in and fetches content from another site. When it's a standalone script it works fine. When I try to include it in any other pages it breaks. The first display of the curl page is a post with username and password. When you submit logs into the remote page, navigates through an landing page, and returns an array of anchors from the final page. As I said earlier it works through all the steps as standalone. When I include it on another page (URL_include) it displays the form and un/pw/submit fine but when you hit submit it immediatly refreshes to the form. Does this just sound like a logic problem or is there a reason for this (curl, url_include) ? TIA, Jeff
  14. Here is my full code. When I enter 'http://www.google.com' as a URL in the text box it works fine. When I enter http://205.188.215.228:8006/ it does not work. <html> <body> <form method="post"> URL: <input type="text" name="url"> <input type="submit" value="Go!"> </form> <? $url = $_REQUEST['url']; if(!$url) exit; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_PORT, '8006'); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); # Get HTML $output = curl_exec($ch); # Close handle curl_close($ch); # Regular Expression to get all ANCHOR tags preg_match_all("@<a[ ]+href\s*=\s*[\"'](.*)[\"'].*>(.*)</a>@isU", $output, $m); $i = count($m[0]); # Create an assoc array for($a=0;$a<$i;$a++) $anchors[$m[2][$a]]=$m[0][$a]; # Display for testing print_r($anchors); ?> </body> </html>
  15. I have my php curl script working with websites on port 80 fine. I'm trying to use it now on sites with an alternate port, in this case 8006. I've tried to set the option: curl_setopt($ch, CURLOPT_PORT, 8006); and curl_setopt($ch, CURLOPT_PORT, '8006'); As well as making the port a part of the URL: www.website.com:8006 Any advice or suggestions wourld be appreciated. TIA, Jeff Murch
  16. I have a page that receives a post. The posted data shows up at the page as $content array. I am writing $content to the session. On a new page I retrieve $content from the session. When I do a print_r everything is there. When I do echo $content (where the key 'email' is joe@somewhere.com) or any of the other rows I get a single character??? TIA
  17. perfect thanks andy. I knew that there had to be somethin better. Jeff
  18. I'd like to find out if there is a standard PHP way/function to do this prior to my trying to write it entirely by hand: I have a mysql query that returns a bunch of columns to an array called $auth: $find = mysql_query("SELECT `username`,`password`,`active` FROM users WHERE `username` = '$username' AND `password` = '$password'"); if (!$find) { die('Could not query1:' . mysql_error());} $auth = mysql_fetch_row($find); This give me an indexed array. I'd like to be able to have an array where each item is labeled with the column that initiated the selection so instead of: [1] Joe [2] password [3] 1 I had an array with [username] Joe [password] password [active] 1 I can do this by hand but there must be a way to dynamically get this info from the query as it is executed eh? TIA, Jeff
  19. I have a value that as is cannot be manipulated arithmatically. The values are in the format '$x,xxx.xx'. Is there a built in PHP function to strip out the $ and the ',' so I can treat this as a integer?
  20. Foo, Have you tried JS. You can give the users immediate feedback instead of waiting to post to the server for the check. Jeff
  21. I have a site with the document root at /var/www/html. The also have an installation of OSCommerce located at /var/www/html/store. I like to set the default include path in php.ini for ease and clarity in coding since the site above the store has many directory levels. When I try to set the default include_path parameter in php.ini to /var/www/html/includes:/var/www/html/store/includes the store crashes. As a work around I can just code all of the includes to the document root include(/includes/whatever.php). This works fine for html files but not for php files even though they are in the same directory. Has anyone run into this or seen this behavior before? I really have two problems that are unrelated I'm sure. TIA
  22. Thanks very much that did it. foreach ($cr_array as $i => $row) { foreach ($row as $k => $v) { echo "Current path: {$i} -> {$k} -> {$v}<br />\n"; } }
  23. I have a multidimensional array with integer autoindexed rows. I've tried using for and while loops and can't get at all 3 columns of data?? What is the correct way to loop thru an array when there are multiple dimensions? [0] => Array ( [1GNDU03E01D134411] => 30e049b900fb8b557976aec2d28cf0d2 ) [1] => Array ( [1B3ES56C43D141358] => cdee6dac61bd7b1d7976aec2d28cf0d2 ) [2] => Array ( [2C4GP44R04R604590] => c111b2875a2055097976aec2d28cf0d2 ) [3] => Array ( [2G2WP522351172282] => 46a554463aac34ea7976aec2d28cf0d2 )
×
×
  • 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.