Jump to content

help needed again


Recommended Posts

yeh that's gonna be the fun bit :)

 

I suppose I will have to parse out the the line rates (don't know how yet) and then run a query of some kind to pull the right pages for my products... there will be a way - it's just finding it. I'll let you know how it goes!

Link to comment
Share on other sites

he he you say easy .. I say eek!

Would that preg match be in the script you did? the broadband checker page or the adsl-availability script?

 

But you are right... I will get onto it! trine you've been a life saver today!

Link to comment
Share on other sites

i'm thinking more on the lines of parsing the xml result from the actual checker called by curl and "limiting" the users choices of options based on that - no point allowing a signup for 8mb if they an only get 2mb - so *probably* instead of fidling with whmcs and the sh!teytemplate system, having our checker allow a selection from valid products only, and a xref table to get the WHMCS links for each product ...

Link to comment
Share on other sites

Rob, absolutely! that can be done, you just need to define all the speed scenarios which are returned in the xml results. As before, you just match them, or store them in a variable and use case to show exactly which products can be signed up for by a user.

Link to comment
Share on other sites

  • 2 weeks later...

Well I started to get too frustrated with making sure I had every variable covered so I'm just going for a quick yes/no solution but I'm stuck.

 

$s_response .= fgets($fsock, 128);

       $pos = strpos($s_response, "Your Exchange is ADSL enabled");

       if ($pos = true)

      { echo "<p class='text'>",
      "[img][/img]", "
","Your Exchange is ADSL enabled and you can receive onestopdigital broadband". "
","[url='broadband.php']Visit out Broadband Pages[/url] for more information.","</p>";

      break;


      }

  		else


  	{	 echo "No Such Luck"; break;
   }

   } 

 

However the else section doesn't kick in. I think i'm not using the if ($pos = true) properly but I'm a bit stuck now as to how to get it working. I think the code shows what I want to happen.

 

Thanks for any pointers,

 

Adam

Link to comment
Share on other sites

ok, but aren't you trying to match the same output? looks like it to me.

 

>> $pos = strpos($s_response, "Your Exchange is ADSL enabled");

 

and before that you connect again:

 

>> $s_response .= fgets($fsock, 128);

 

instead, you could just do:

 

$pos = strpos($result, "Your Exchange is ADSL enabled");

if ($pos = true){ do stuff }

else { do something else }

 

That will avoid connecting again and make it slightly faster!

Link to comment
Share on other sites

You couldn't as you can't have if ($pos = true) when using strpos it needs to be ===false or an integer match ?

 

I need to have $s_response .= fgets($fsock, 128); otherwise nowhere do I set what the s_response string is. If I take that out strpos is checking against nothing?

 

Is what I thought anwyay :S

 

Adam

Link to comment
Share on other sites

Yes but your script only deals with the information posted to the page and not the ajax. This way the result is parsed before being returned by either script.

 

Also $result must take its information from $s_response as it returns my custom messages as it is rather than a default response.

 

I don't admit to understanding everything but I know it works :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated