Jump to content

Dooley28

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by Dooley28

  1. Hey all, Using LAMP with Javascript I want to build a multi-tiered drop down menu. My problem is that with most guide online one you click on the final tier it's usually a link to another page. What I'd I would like its a multi-tiered drop down menu within a form and when you choose the final option it sets a POST value of "tier1chosen/tier2chosen/tier3chosen.." then stay on the current page allow a user to continue filling out the form. Can anyone help with this or point me to a guide online? Thanks, Dooley28
  2. Cool that's perfect. Thank you sir!
  3. Oh any grammar to be honest. So "Here is, some text!! Sir...." would go to an array something like this. array[0]=Here array[1]=is array[2]=some array[3]=text array[4]=Sir That would be great. Cheers
  4. Hey all, Was just wondering if anyone had a simple regex to rip all grammar out of a sentence or where I could get one? Thanks!
  5. Sorry for the delay, yeah something along the lines of this http://4umi.com/web/javascript/slider.htm Thanks again for the help!
  6. Hi there, I was wondering if anyone knows a way of creating a slide bar in php? I'm aware of ways to do it using ajax but I would rather not use that. Thanks for your help!
  7. 1. Describe your problem or background that is important to it. 2. Give sample data (the input data, the haystack...etc..) 3. Give the expected output/matches from your sample data. 4. Give the actual output that you have if you've attempted something already. 5. Provide code if necessary, if your problem concerns it. 6. We assume its a php regex related as this is phpfreaks, but you still need to specifiy (if not obvious) if you are talking about POSIX (ereg) or PCRE (preg) flavor. 7. Be patient/grateful and don't demand things. Regex questions may take longer than expected to be answered, they're tougher sometimes. Hi, Im trying to return a definition of a keyword using dictionary.com, im using curl on this site and am trying to use a regex to output the data. The specific tags I want are here. <ol type="1"><li>Something, such as a fetter, cord, or band, that binds, ties, or fastens things together.</li> <li>Confinement in prison; captivity. Often used in the plural.</li> <li>A uniting force or tie; a link: <i>the familial bond.</i></li> <li>A binding agreement; a covenant.</li> <li>A duty, promise, or other obligation by which one is bound.</li> <li><ol type="a"><li>A substance or agent that causes two or more objects or parts to cohere.</li> <li>The union or cohesion brought about by such a substance or agent.</li> <li>A written and sealed obligation, especially one requiring payment of a stipulated amount of money on or before a given day.</li> <li>A sum of money paid as bail or surety.</li> <li>A bail bondsman.</li> </ol> </li> <li>A chemical bond.</li> <li>A systematically overlapping or alternating arrangement of bricks or stones in a wall, designed to increase strength and stability.</li> <li><i>Law</i> <ol type="a"><li>A written and sealed obligation, especially one requiring payment of a stipulated amount of money on or before a given day.</li> <li>A sum of money paid as bail or surety.</li> <li>A bail bondsman.</li> </ol> </li> <li>A certificate of debt issued by a government or corporation guaranteeing payment of the original investment plus interest by a specified future date.</li> <li>The condition of taxable goods being stored in a warehouse until the taxes or duties owed on them are paid.</li> <li>An insurance contract in which an agency guarantees payment to an employer in the event of unforeseen financial loss through the actions of an employee.</li> <li>Bond paper.</li> </ol> So the tags I want are opening <ol type="1"> closing tag </ol>. Here is the regex im using. $regex='<%ol type="1"%[^>]*>(.*?)</%ol%>'; preg_match_all($regex, $text, $result, PREG_PATTERN_ORDER); return $result = $result[0]; Which is giving me the error .... Warning: preg_match_all() [function.preg-match-all]: Unknown modifier ']' The error points to the preg_match_all line, which makes me believe its the regex itself. Thanks for the help.
  8. Hi sorry, Was in a rush didn't elaborate. Apologies.. Here's the code im trying to implement <?php /** * This set of functions queries MSN Search API. * * This is a single php page and set of functions that, when given the right * data will return a set of formatted MSN search results. Requires NuSOAP, * located at http://sourceforge.net/projects/nusoap/. * Stick this file into a folder in your server along with NuSOAP * library and point your browser there for action. Don't forget to get * an MSN Application ID (see http://search.msn.com/developer) * * Read the related blog post here: * http://www.fiftyfoureleven.com/weblog/web-development/programming-and-scripts/apis/msn-search-api * * @author: Mike Papageorge, http://www.fiftyfoureleven.com/contact * @lastUpDate: 14/11/2005 * @license: http://creativecommons.org/licenses/by/2.5/ * @location: http://www.fiftyfoureleven.com/site/code/msn-search-api-sample.txt */ error_reporting(E_ALL); // Variables for the search. You need to edit these to use this: $id = 'my developer key'; $site = ''; $numresults = 30; $baseurl = 'http://soap.search.msn.com/webservices.asmx'; // MSN API URI $form = ' <form action="'.$_SERVER['PHP_SELF'].'" method="get"> <label for="p">Search Terms</label> <input name="p" id="p" type="text" /> <input type="submit" value="search" /> </form> '; /** * A little 'controller' to make this sample page work: * */ $xhtml = ''; if(isset($_GET['p']) && $_GET['p'] != '') { $data = getResultArray($id, $site, $baseurl, $numresults); $xhtml = $form.formatMSNResultset($data, $numresults); } else { // If an empty search was given: $xhtml = (isset($_GET['p']) && $_GET['p'] == '') ? '<p>Please enter a search term</p>':''; // Show the form: $xhtml .= $form; } echo $xhtml; // // // Here be functions.... // // /** * Build an array with the parameters we want to use. * */ function setParams($id, $site, $numresults) { $params = array( // Details for all of these can be found in the developer's kit, // in the help file. 'AppID' => $id, 'Query' => "My Query", 'CultureInfo' => 'en-US', 'SafeSearch' => 'Off', 'Requests' => array ( 'SourceRequest' => array ( 'Source' => 'Web', 'Offset' => 0, 'Count' => $numresults, 'ResultFields' => 'All' ) ) ); return $params; } /** * This function passes our data to NuSOAP, and * returns the search results: */ function getResultArray($id, $site, $baseurl, $numresults) { // Get the parameters: $params = setParams($id, $site, $numresults); // Include the library: include_once("nusoap.php"); // Create a instance of the SOAP client object $soapclient = new soapclient($baseurl); $data = $soapclient->call("Search", array("Request"=>$params)); return $data; } /** * This function formats our MSN specific array: * */ function formatMSNResultset($data, $numresults) { // If no results were found: if($data['Responses']['SourceResponse']['Total'] == '0') { $results = '<p>There were 0 results found with MSN search. Please try again by typing your search terms into the search box, and then click search.</p>'; return $results; } // Now down to business: $tmp = ''; foreach($data['Responses']['SourceResponse']['Results']['Result'] as $key => $value) { $tmp .= '<dt><a href="'.$data['Responses']['SourceResponse']['Results']['Result'][$key]['Url'].'">'.$data['Responses']['SourceResponse']['Results']['Result'][$key]['Title'].'</a></dt> '; $r = htmlentities($data['Responses']['SourceResponse']['Results']['Result'][$key]['Description']); $tmp .= '<dd>'.$r.'</dd> '; } $results = '<h1>Viewing '.$numresults.' of '.$data['Responses']['SourceResponse']['Total'].' results found by MSN search.</h1> <dl> '.$tmp.' </dl>'; return $results; } ?> Blantently stolen from the internet but this is just a text, I do need to be able to query a search engine and heres the error I get. Warning: SoapClient::SoapClient(http://soap.search.msn.com/webservices.asmx) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/page/survey/getdefinitions.php on line 96 Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "http://soap.search.msn.com/webservices.asmx" in /var/www/page/survey/getdefinitions.php on line 96 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://soap.search.msn.com/webservices.asmx' in /var/www/page/survey/getdefinitions.php:96 Stack trace: #0 /var/www/page/survey/getdefinitions.php(96): SoapClient->SoapClient('http://soap.sea...') #1 /var/www/page/survey/getdefinitions.php(43): getResultArray('2725F7DF7AE0E9A...', '', 'http://soap.sea...', 30) #2 {main} thrown in /var/www/page/survey/getdefinitions.php on line 96 So effectively it doesn't see the mircosoft live, server. And as I said when I bang the code up to a server it works perfectly. That why I assume it's an issue with php connection to the web. As you can see I don't need the soap module installed, i'm using nusoap. Thanks again for any light you can shed on the subject.
  9. Hi all, I'm developing a app that needs to calls MSNs live search api using nusoap. However on my laptop the calls don't work but when I upload the php script to my server it's works perfectly. Im using ubuntu, do I need to open ports or modify any php settings. Thanks in advance for any help Dooley
  10. Hey jeet thanks for your help, I've found a couple of open source project but none of them seem to be in development anymore. And there is no software that just "works" i'm currently trying to fix pmreport with has a few database errors hopefully i'll be able to fix em. But if anyone had tried any phpreport software the "know" will work fairly well that would be great.
  11. Thanks for your reply jeet. I gave php report a shot, I have my databases on a remote unix server and php report maker doesn't want to connect to it. Can I just get the web based php code of this software? I was wondering if you know of a solely web-based version of software like this. Thanks again.
  12. Hi there, I'm looking for a decent php report-generation software and I was hoping someone here would be able to help me. I want a system that is fully web based and can pull specific items for an sql database and display them graphically. Preferably it would have a GUI so the admin could choose which items from the database it would pull and be able to display the items using graphs for regular users of the system. Ie a standard user doesnt have access to the raw sql data. Thanks in advance for your help.
×
×
  • 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.