Jump to content

nadeemshafi9

Members
  • Posts

    1,245
  • Joined

  • Last visited

Posts posted by nadeemshafi9

  1.  

    // \s = Used together, as /ms, they let the "." match any character whatsoever, while still allowing "^" and "$" to match, respectively, just after and just before newlines

     

    // \i means lower or upercase eg preg_match("/<pre>.*<\/pre>\i/",  $html, $matches);

  2. 
    $matches = array();
    preg_match("/Code:\i.*<pre.*>.*<\/pre>/",  $html, $matches);  // the backslash may be an issue
    foreach($matches as $_matches_k => $matches_v){
    foreach($matches_v as $matches_v_k  =>  $matches_v_v){
    	$attributes = array();
    	//get all attributes
    	preg_match('#([^\s=]+)\s*=\s*(\'[^<\']*\'|"[^<"]*")#', $matches_v_v, $attributes);
    	printr($attributes); // printr($attributes[0]); printr($attributes[1]);
    	echo "********************************************";
    }
    }
    

  3. http://www.regular-expressions.info/posix.html

    http://perldoc.perl.org/perlre.html

     

    PREG = Perl Compatible Regular Expressions (PCRE):

    EREG = Regular Expression (POSIX Extended)

     

    http://uk3.php.net/manual/en/ref.regex.php

    http://uk3.php.net/manual/en/ref.pcre.php

     

    //values for pre
    
    $matches = array();
    // . means any character * means 0 r more times ? means 1 or more times and theres another for 1 time
    // i without a \ means lower or upercase eg preg_match("/<pre>.*<\/pre>i/",  $html, $matches);
    // PREG = Perl Compatible Regular Expressions (PCRE):
    // EREG = Regular Expression (POSIX Extended)
    preg_match("/<pre>.*<\/pre>/",  $html, $matches);  // the backslash may be an issue
    
    //now look into the array
    echo "*****************************************<br><br>";
    echo "*******************BEFORE****************<br>";
    echo "*****************************************<br><br>";
    print_r($matches); // print_r($matches[0]);  print_r($matches[1]); 
    
    /*
    $matches[0] will contain an array with the text that matched the full pattern, 
    $matches[0][0];$matches[0][1];$matches[0][2];$matches[0]etc. etc...
    $matches[1] will have an array with the text that matched the first captured parenthesized subpattern, and so on. 
    $matches[1][0];$matches[1][1];$matches[1][2];$matches[1]etc. etc...
    */
    
    // you can cycle throgh and alter them
    
    foreach($matches as $_matches_k => $matches_v){
    foreach($matches_v as $matches_v_k  =>  $matches_v_v){
            // PREG = Perl Compatible Regular Expressions (PCRE):
            // EREG = Regular Expression (POSIX Extended)
    	$matches[$_matches_k][$matches_v_k ] = ereg_replace("<pre>", "", $matches_v_v);
    	$matches[$_matches_k][$matches_v_k ] = ereg_replace("<\/pre>", "", $matches_v_v); // the backslash may be an issue
    }
    }
    echo "*****************************************<br><br>";
    echo "*******************AFTER*****************<br>";
    echo "*****************************************<br><br>";
    print_r($matches); // print_r($matches[0]);  print_r($matches[1]);  

     

     

  4. Try to use 192.168.1.1 ( IP address )

     

    do you think his router loops back or somthing ? i dont get it whats your logic ? trying to guesss his local address  ?, i personaly think you need to right click and set permissions on the folder or joomla is installed incorectly tell us what inputs u put into joomla an dthe exact steps you took there aint many.

  5. look at this

    public function submitpasformAction(){
    
    	$actionURL = "https://83.231.137.172/barclays/tdsecure/pa.jsp";
    
    	$keyvalpairs = "";
    	$hsbc 					= new Hsbc();
    
    	foreach($this->getRequest()->getParams() as $k => $v){
    		$keyvalpairs .= "&{$k}={$v}";	
    	}
    
    
    	$result = $hsbc->pasRequestX($actionURL, $keyvalpairs);
    
    
    	// match all HTML tags **************************************
    	preg_match_all("/<\/?\w+((\s+\w+(\s*=\s*(?:\".*?\\\"|.*?|[^\">\s]+))?)+\s*|\s*)\/?>/s", $result, $matches);
    	// Get the action URL of the form ***************************
    	$formtags = "";
    	foreach($matches[0] as $k => $v){
    		if(ereg("<form", $v)){
    			$formtags .= $v;
    		}
    	}
    
    
    	preg_match_all("/action=\"*.*?\"/i", $formtags, $url);
    	@$action = $url[0][0];
    	$action = ereg_replace("action=", "", $action);
    	$actionURL = ereg_replace("\"", "", $action);
    
    	/////////////////
    
    	unset($matches);
    
    	preg_match_all("#<input(?:\s+[^>]+)?>#si", $result, $matches);
    
    
    	$input_feilds = $matches[0];
    
    	$keyvalpairs = "";
    
    	//print_r($matches);
    
    	foreach($input_feilds as $k => $v){
    		preg_match_all('#([^\s=]+)\s*=\s*(\'[^<\']*\'|"[^<"]*"|"(.*)")#', $v, $matches); // match all xml attributes
    		$name = "";
    		$value = "";
    
    		foreach($matches[0] as $matches_k => $matches_v){
    			$o=substr($matches_v, 0, 5);
    
    			if(ereg("name", $matches_v) || ereg("id", $matches_v)){
    				if(ereg("name", $matches_v)){
    					$kvpairs[$k]['name'] = ereg_replace("\"", "", $matches_v);
    					$kvpairs[$k]['name'] = ereg_replace("name=", "", $kvpairs[$k]['name']);
    				}
    			}
    			else if($o == "value"){
    				$kvpairs[$k]['value'] = ereg_replace("\"", "", $matches_v);
    				$kvpairs[$k]['value'] = ereg_replace("value=", "", $kvpairs[$k]['value']);
    			}
    		}
    
    	}
    
    	//print_r($kvpairs);
    
    	foreach($kvpairs as $k => $v){
    		if($k != 2){
    			$keyvalpairs .= "&{$v['name']}={$v['value']}";
    		}
    	}
    
    
    	//$keyvalpairs = stripslashes($keyvalpairs);
    	//$keyvalpairs = urldecode($keyvalpairs);
    
    	$result = $hsbc->pasRequestX('https://www.ccpa.hsbc.com:443/ccpa', $keyvalpairs."&ResultUrl=https://secure.isrighthere.net/api/purchase/getdetails");
    
    	echo $keyvalpairs;
    	echo $result;
    	exit;
    
    	$responseArray['id'] 				= "purchase result";
    	$responseArray['success'] 			= "true";
    	$responseArray['msg'] 				= $result;	
    
    	$dojoData = new Zend_Dojo_Data();
    	$dojoData->setIdentifier('id') 
         				->setMetadata($responseArray); 
    	echo $dojoData->toJson();
    	exit;
    }
    

  6. what happens is that when i post stuff to the server using cURL it responds with a HTML doc and then i extract the values from the hidden input fields.

     

     

    now this value in particular is the problem in more than one instance, as it is generated i doubt it changes in teh session but it somtimes passes the check and somtimes dosent ? eg somtimes completly breaks anything even a substr() and then it dosent go into teh array.

     

    here is a sample of what i am doing

     

    but let me warn you the server that recives the result on teh other end to whom i post this to says the data is CORUPTED all i am doing is reciving it and sending it on.

     

    my algorithm works in step one me to CCPA server and then from CCPA server to me and then from ME to the correct poayer authentication visa thingy

     

    then the vis thingy gives me a form in a html doc rember i am sending the codes they give me and everything is flowing nicley

     

    i get teh form split it up and present it in my window wrapped in a form and action tags extracted from teh message.

     

     

     

     

     

    PROBLEM

     

    i submit the form with it i have to submit like in other steps 3 or 4 variables that came from the server itself, this one in particular in prior steps FALLS somtimes

     

    somtimes it goes into place somtimes it dosent

     

    eg somtimes ereg('value', blah) detects it somtime it doisent.

     

    but in that case it somtimes does go throgh eg every 4 atempts.

     

     

    in this case it goes throgh but the server on teh other end says its corupted data.

     

    this is the last step aswell ):

     

     

     

    our networks are firewalled against any internet access without purchase so they cant use the normal IFRAME METHOD i have to do everything throgh cURL

     

  7. why does this not work ??

     

     

    
    $string = 'value="eNrNmGvTosiSgP9Kx5yPnhnuChP2G1HFXQVB7nzjJhdBUNBCfv2idve829ERO3M
    +7K4RhkValZVZlflUUmu7uGaZYGXJ7Zp9rLWs76M8+1KmX3/TYyJdZukRp5NkmbFHKmKzVczSaZYw8YqOCYpYJsvlCv/tY22AQ9a
    /Rr1a/2ToPbv2ZXv+IP7A/yDX2PfH2ZRrUkTn4WMdJReo6h80yeEkvca+Pa6b7KoKH84WJ5Yszi0JGRo4scbe4jX213jj9mz1s3tjmX4gHFVUF05twLnZwGYY2SwXPXYTH
    +rXNfbssU6jIfsgcZzDlzjzhWD+pLk/cXaNveTr7qkONO1t1k3g+Br7LFjP63jNzsnjgyWXa+zH0zobu/aczT1mH3+019hftnXR+QP
    /9FnhFDXrnqVr2/9YD2Xz2abl0yZydvclX/dDNNz6j2CNfWutk+h+/wAAQECbuYTmFtiaKg988P7Mvr66rLOk/MCZ2aj59zUK1Hl7LYeieZr63wVr7GkK9trjj7VV5ud5smv2ZWzqc
    //1t2IYuj8xDCH0B6L+aK85NhuMYziHzR3Svsz/9dt7VJaq52P7j4bx0bk9l0lUl1M0zAGiZUPRpl9+2PYrNfbhqYnADiL/+6zq94Sgz78
    /JThFMLNO7NdKP3n2d2b52dhrH/3eFxHxnOAnRR/rQ3bMnhGRfXEO6tff/vWP00Uo86wf/hO7vt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bRscuIFpFFO60dhmH6RQ2A
    /I1QEPibBoz8m/O50pXXPOmDd2d86NkJaMZeaWunEc2FNbbCLC4bG0ClfbGsvOUy81eP4oU8iGqpyL7QtGwyP0/KYOV4g6bSh8XcpMKiKUKfNjjidmOOtxI6xvC2GJDaoHTyaKe92HMZcjY21sJ0BVuKqTDihOvGbyWSpabXopunkbfttuMHwkTv7sjoqQXqS
    +nR1pzRuseKCrTdmRTjih9icz2A2lhufXDLHfdihHXJY2QnExgIkLsNbYEYr6bTVEiNBi4UQhxcNgJhqdvrl4C+hXOLE5SzgHGW6MnaOsBa0LAOEZrM6YgVPZbdSPdcFHOeXuYHi2OmsYdU1Wu4JddXYhHyXul3uG4EioK
    +/qpixv64qsB/XF39dbLwuRl93vM/LvM93v/8FSe009w=="';
    
    if(eregi("value", $string)){
            echo "found";
    }
    else if(eregi("value", urldecode($string))){
            echo "found";
    }
    
    

     

    thanks

     

    be aware that the $string is cut and paste from FIREBUG so the /'s may mean somthing

     

    thanks

  8. try this

     

    while ($row = mysql_fetch_assoc ($results)) {
    if ($pulmonologist == ''){
    	echo "";
    }
    elseif ($pulmonologist == 'none'){
    	echo "";
    }
    else{
    	if ($row['sentemail'] == 'y') {
    		echo "<img src='../consults/images/greencheck2.png' alt='greencheck' width='15' height='20' border='0'/>";
    	}?>
    	<a href="notify.php?action=edit&id=<?php echo $row['id_incr']; ?>">
    	<img src="../consults/images/notify.jpg" alt="Notify Doc" width="80" height="20" border="0" /></a><?php
    }
    ?>
    </td>
    </tr>
    <?php
    }
    ?>
    

     

     

    i donmt think you have your tabel right or your if statment, are you trying to access the returned assoc array ?

  9. So to sum it all up:

    1- I would like to display the entries in a db, and an edit button next to it.

    2- When you click the edit button, the name of that button is requested on the edit page, and the appropriate data is selected from the table.

     

    I hope I have been clear enough. If I haven't please let me know, I will try to clarify everything. Thanks in advance,

    Qopzeep

     

    it used to be realy awkward to do this and you had to set up all sorts of links etc for directional sort paging and all sorts, nowe we have frameworks that reqest JSON or XML from your script so basicaly you have a page that outputs the rusults from a query into XML or JSON and the javascript compoennt from the framework creates teh grid and has a button wich sends a SORT DIRECTION, SEARCH or PAGE START LIMIT string with the post when you click it and revieves the data again this time filtered by the POST.

     

    Application nowerdays run off XML and JSON scripting is used to refine things , data griding and feeding is JSON

     

    you need a grid ? that searches sorts and pages ?

     

    dl extjs in js

     

    instantiate a grid panel

    instantiate a searchbar

    instantiate a store (json or xml) (give it teh url of the php page you wish to output the plain text JSON or XML)

    instantiate a paging toolbar

     

    add the store to the toolbar

    add the store to the grid

    add the store to the search

     

    insert a paging toolbar into the gridpanel

    insert a search into the gridpanel

     

    in your php script when you revieve posted data from teh components just filter your sql with it.

     

    http://extjs.com/

    http://extjs.com/deploy/dev/examples/samples.html

    http://extjs.com/deploy/dev/examples/grid/edit-grid.html

    http://extjs.com/deploy/dev/examples/grid/paging.html

    http://extjs.com/deploy/dev/examples/form/custom.html

  10. hi guys

     

    i am comminicating with the bank servers and basicaly i cant use there forms and there prewired js submited iframes etc because of firewall rules. i need to extract the action and input hidden and text fields from there forms and cURL them , my algorithm uses a explode explode explode but its not effective it falls when there is a space or the input type is different etc.

     

    i need some regex that will take the input feilds out completly and place them into an array or a string then i need the names of each input and there types and i also need the action of the form.

     

    Any quickies all good

     

    Thanks

  11. Ah, thanks for all the replies everyone.

     

    To answer a few questions - yes, I would imagine every second would be fine, but apparently my host thinks differently. I'm also tempted to set up my own server but I'm afraid my internet speed isn't quite good enough for the job.

     

    I'll check out the links. Do you know if they can be integrated in with my current membership base?

     

    iif its coded in php then it can be adapted to any php app.

  12. guys i knwo about url encoding and stuff but i need to send a string to a server

     

    i send it using cURL POST

     

    basicaly like &blah=blah&blah=blah

     

    but i have this string it gets corrupted

     

    eJxVjzsOwjAQRK+yygFiQr1sQygoqOACFp6AJX8k2+H8fGyDKGfezmiWL/cEzGdc1wThE3LWN5A1u2EahA8pxST8QMo2BpnGzbhl1SXjjffRQF7uT1S

    /dUnvhHfwCIVCLKTJYLEBhnzFLd9DtWJG0dbJMSxOFxB95rTLxli1jeobVX8/PQGNcVD3

     

    what do i need to do to it to send it throgh cURL weithout having issues.

     

    thanks

  13. download jquery include it and create a php file which outputs your popup

     

    function onmouseover(){
         newdiv=document.createElement('div');
          newdiv.id = 'thepopup';
         newdiv.style = 'position: absolute; top: 40%; left: 40%;';
         newimg.onclick=closebox();
         
        //JQUERY
         $.ajax({
          type: "POST",
          url: "getmypopupcontent.php",
          data: "name=John&location=Boston",
          success: function(msg){
           newdiv.innerHTML = msg;
         });
         document.body.appendChild(newdiv);
    
    }
    
    function closebox(){
          document.body.removeChild('thepopup');
    }
    

  14. Hello

     

    We are implementing the PAS service on our intranet application. We are receiving errors, the following will explain our process:

     

    1. We submit the details to the CCPA service using cURL()

        - The CCPA service returns a HTML doc with form hidden inputs ERROR CODE  of 5(the cardholder has failed auth

          ask for another card) and a form wired to go off to the relevant card verifier (verified by visa).

                --- i am concerned we might be failing right here but i doubt it.

                * We extract the action URL from the form and the hidden values of:

                    MD

                    PaReq

                    TermUrl

     

    2. We POST these to the relevant card verifier specified in the CCPA result form using cURL().

        - The card verifier returns a html doc containing a form wired to self submit

              * we extract the url it wants to submit to, which is the TermUrl and the data:

                MD

                PaRes

     

    3.We submit the values of the card verifiers response form back to the TermUrl (the CCPA server port).

        - The CCPA server returns a html doc that has a form wired to submit with and ERROR CODE 9 (the CCPA was unable

          to interpret the results from the payer authentication or enrolment service) and all the other CCPA variables like card type etc etc.

     

     

     

    Do you have any suggestions.

     

    Thanks you for your help

  15. just pull down text and it should be ok to pull dowqn every milisecond if you like.

     

    1000 requests a second per user should be ok?

     

    yeh why not lol

    Are you serious?

     

    not realy but im sure you can send text throgh ajax and receive it if you do it smart enogh without problems, how do you think javascript IM forum does it.

×
×
  • 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.