Jump to content

tomasd

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomasd's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I'm trying to call pdfp application which I use to print pdf's via .bat file. And while this is happening display a message saying "please wait printing". The problem I have is that exec() function waits for my .bat file to exit before loading the page. Is there any way of telling exec() to either not wait for return code from .bat or get it to start after the page has loaded? Thanks!
  2. Thanks very much, it worked I ran into another challenge now ??? If let's say I use this: <script language="JavaScript"> function increment(name){ z=z+1; document.order[name].value=z; } </script> <script language="JavaScript"> z=0; </script> <form name="order"> <input type="button" value="+" onclick="increment('test1');"> <input type="text" name="test1" size=1 value=0> <input type="button" value="+" onclick="increment('test2');"> <input type="text" name="test2" size=1 value=0> </form> What happens is that I'm using same z value for both test1 and test2 input fields and if I increment one and then increment another it takes value from the first and then increments to the second is there any way of making them to increment independently?
  3. Thanks for quick reply, I did this: <script language="JavaScript"> function increment(test){ z=z+1; document.order[test].value=z; } </script> <script language="JavaScript"> z=0; </script> <form name="order"> <input type="button" value="+" onclick="increment(test)"> <input type="text" name="test" size=1 value=0> </form> And that is no joy am I doing something wrong?
  4. Hi, I've got a little code which increments/decrements a value from the form: function increment(){ z=z+1; document.order.Button1.value=z; } function decrement(){ if (document.order.Button1.value>0){ z=z-1; document.order.Button1.value=z; } } If there any way of passing something else to the function (not Button1) for example: function increment(var){ z=z+1; document.order.var.value=z; } function decrement(var){ if (document.order.var.value>0){ z=z-1; document.order.var.value=z; } } Thanks very much!
  5. Hi all, I have table tuples which contain date and decimal values. i.e. 2008-09-01 25 2008-09-07 14 2008-09-10 17 Is there any way of doing select so it outputs following; 2008-09-01 25 2008-09-02 25 2008-09-03 25 2008-09-04 25 2008-09-05 25 2008-09-06 25 2008-09-07 14 2008-09-08 14 2008-09-09 14 2008-09-10 17 thanks for your help!!!
  6. Hi, Can somebody please tell me how to select tuple containing timestamp that is closest to now()? i.e. if I have data like 2008-09-18 14:31:04 2008-09-18 14:31:06 2008-09-18 14:32:04 2008-09-18 14:35:04 2008-09-18 15:31:04 How can I do select that would give me 2008-09-18 15:31:04?
  7. Hi, Can somebody please tell me if it is possible to exit from a cycle in for loop? for example; <?php for ($i=0; $i<10; $i++) { if ($i < 5){echo "$i\n";} if ($i == 5){break;} if ($i > 5){echo "$i\n";} } ?> I'm expecting a result of 0 1 2 3 4 6 7 8 9 but I'm getting a 0 1 2 3 4 What am I doing wrong? Thanks very much!
  8. ok finally I got it... $regex = "Regular FareAdult(\d+.\d{2}) (\w{3})(\w{3},.)(\d{1,2} \w{3} \d{2})FlightFR (\d{3,4})(\d{2}:\d{2}).Depart(\d{2}:\d{2}).Arrive"; preg_match_all("/($regex)/", $data, $result, PREG_PATTERN_ORDER); Can somebody please tell me how can I pass below $regex_price = "Regular FareAdult(\d+.\d{2}) (\w{3})"; $regex_date = "(\w{3},.)(\d{1,2} \w{3} \d{2})"; $regex_flight = "FlightFR (\d{3,4})"; $regex_depart = "(\d{2}:\d{2}).Depart"; $regex_arrive = "(\d{2}:\d{2}).Arrive"; to preg_match_all("/(??????)/", $data, $result, PREG_PATTERN_ORDER); ? thanks!
  9. Hey, thanks for the code, I've tried running it and it looks like it might work. I'm a little worried I might run in other problems if I abandon my current method, the reason is because of what happens after data is written to an array... Could you please tell me (as you already did once) how can I change my current regex so if one part of it doesn't match, nothing matches?
  10. hey thanks for your reply quite possibly, if you could please tell me how can I extract bolded from the following; Regular FareAdult19.99 GBPWed,22 Oct 08FlightFR 214407:00Depart11:35Arrive if possible could you please reuse my original syntax? my $data is contains stripped html which I'm getting via curl ... DayNext Day »Select A FlightSelect a FlightSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 20306:30 Depart07:45 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 20508:10 Depart09:25 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 20709:35 Depart10:50 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 21711:15 Depart12:30 ArriveRegular FareAdult24.99 GBPThu, 25 Sep 08FlightFR 21112:00 Depart13:15 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 22515:45 Depart17:00 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 29517:10 Depart18:25 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 22718:30 Depart19:45 ArriveRegular FareAdult9.99 GBPThu, 25 Sep 08FlightFR 29319:35 Depart20:50 ArriveSPECIAL OFFERAdult0.00 GBPThu, 25 Sep 08FlightFR 29721:45 Depart23:00 ArriveSelect Your Flights and C...
  11. hey thanks for the tip, I tried; preg_match_all("/$regex_fare.*?.$regex_date.*?.$regex_flight_and_depart.*?.$regex_arrive/", $data, $result, PREG_PATTERN_ORDER); but $result array returns as empty. To clarify further on what I'm trying to do here... The problem I'm having with my regex is that it continues to match $regex_date $regex_flight_and_depart $regex_arrive and write the values to an array when $regex_fare = "(Regular FareAdult(\d+.\d{2}) (\w{3}))" is not matched. That is when my $data fare field looks different like SPECIAL OFFERAdult or NO TAXESAdult not Regular FareAdult. My $data contains ~10 results and they're not the same i.e. I have 3 Regular FareAdult, 2 SPECIAL OFFERAdult and some NO TAXESAdult. What I'm trying to achieve is to parse all and only results starting with Regular FareAdult from $data, then all and only results starting with SPECIAL OFFERAdult and lastly all results starting with NO TAXESAdult... but with my current syntax my regex is treated like 4 regex not 1.
  12. Hi, I have regex funtion extracting flight details from my data; <?php function regex_($data) { // Sample data: // Regular FareAdult19.99 GBPWed,22 Oct 08FlightFR 214407:00Depart11:35Arrive // Regular FareAdult19.99 GBPWed,22 Oct 08FlightFR 214817:05Depart21:40Arrive $regex_fare = "(Regular FareAdult(\d+.\d{2}) (\w{3}))"; $regex_date = "(\d{1,2} \w{3} \d{2})Flight"; $regex_flight_and_depart = "FR (\d{3,4})(\d{2}:\d{2}).Depart"; // $regex_depart = "(\d{2}:\d{2}).Depart"; $regex_arrive = "(\d{2}:\d{2}).Arrive"; preg_match_all("/$regex_fare|$regex_date|$regex_flight_and_depart|$regex_arrive/", $data, $result, PREG_PATTERN_ORDER); return $result; } ?> It all works just fine, the only problem is that my data sometimes differs i.e. Regular FareAdult19.99 GBPWed,22 Oct 08FlightFR 214407:00Depart11:35Arrive SPECIAL OFFERAdult19.99 GBPWed,22 Oct 08FlightFR 214407:00Depart11:35Arrive NO TAXESAdult19.99 GBPWed,22 Oct 08FlightFR 214407:00Depart11:35Arrive And often I'm getting only parts like $regex_date $regex_flight_and_depart $regex_arrive matched, but not $regex_fare as $regex_fare differs time to time (Regular Fare|SPECIAL OFFER|NO TAXES). My question is how can I run my regex as 1 long regex so if 1 part of it is not matched, nothing is matched? I tried preg_match_all("/$regex_fare.$regex_date.$regex_flight_and_depart.$regex_arrive/", $data, $result, preg_match_all("/($regex_fare)($regex_date)($regex_flight_and_depart)($regex_arrive)/", $data, $result, but no joy, any help is appreciated.
×
×
  • 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.