Jump to content

simonp

Members
  • Posts

    132
  • Joined

  • Last visited

Everything posted by simonp

  1. I'm getting a sort code input from a text box but people are typing it in different ways eg: 40-21-20 40 21 20 How can I strip away hyphens and spaces from this string so I just get: 402120 Thanks Simon
  2. Thanks Yesideez - worked a treat Cheers Simon
  3. Hi, I need to be able to split an e-mail address at the @ symbol eg input - "fred@bbc.co.uk" string1 = "fred" string2 = "bbc.co.uk" How would I go about that? Cheers Simon
  4. Thanks thorpe - that worked a treat Cheers Simon
  5. I'm passing an encrypted string to a PHP script but if the string includes a plus sign it gets replaced with a space!? WTF?! Eg: https://www.xxx.com/login.php?u=abc&p=nqB7tQflgsxR4Zag7eAl1ngujbHn+4gKm3rcKLmA1tg= I then use: $encryptedpass = $_GET['p']; but $encryptedpass equals nqB7tQflgsxR4Zag7eAl1ngujbHn 4gKm3rcKLmA1tg= (note the plus sign halfway through has been replaced with a space) How can I stop this happening? Is there a chance other characters could cause a problem? Thanks Simon
  6. hmm - thanks for your help - but I still can't get it working properly. Here's the whole script - can you see what might be wrong?! It works if I uncomment out the arrays but not if I use the foreach statment. <?PHP $domain = $_POST['domain']; $arrayofdomains = explode("\n", $_POST['domain']); $signkey = 'xxxx'; $partnerid = 'xxxx'; // Include the NuSOAP library. require_once('lib/nusoap.php'); // Create a new client by providing the endpoint to the constructor. $client = new soapclient('https://api.sedo.com/api/sedointerface.php'); // Send the data with UTF-8 encoding. $client->soap_defencoding = 'UTF-8'; // Dont convert the recieved data in ISO. $client->decode_utf8 = false; // Check for errors $error = $client->getError(); if ($error){echo $error;} $arrayofdomainentries = array(); foreach ($arrayofdomains as $domain) { $arrayofdomainentries[] = array( // first element 'domain' => $domain, 'category' => array('x'), 'forsale' => x, 'price' => 'xxx.00', 'minprice' => 'xxx.00', 'fixedprice' => x, 'currency' => x, 'domainlanguage' => 'en' ); } //$arrayofdomainentries[] = array( // first element // 'domain' => 'testdomain1.co.uk', // 'category' => array('x'), // 'forsale' => x, // 'price' => 'xxx.00', // 'minprice' => 'xxx.00', // 'fixedprice' => x, // 'currency' => x, // 'domainlanguage' => 'en' // ); //$arrayofdomainentries[] = array( // first element // 'domain' => 'testdomain2.co.uk', // 'category' => array('x'), // 'forsale' => x, // 'price' => 'xxx.00', // 'minprice' => 'xxx.00', // 'fixedprice' => x, // 'currency' => x, // 'domainlanguage' => 'en' // ); //$arrayofdomainentries[] = array( // second element // 'domain' => 'testdomain3.co.uk', // 'category' => array('x'), // 'forsale' => x, // 'price' => 'xxx.00', // 'minprice' => 'xxx.00', // 'fixedprice' => x, // 'currency' => x, // 'domainlanguage' => 'en' // ); // Set the values for the array $params = array('username' => 'xxxxx', 'password' => 'xxxxx', 'domainentry' => $arrayofdomainentries, 'partnerid' => $partnerid, 'signkey' => $signkey ); // Call the SOAP method $result = $client->call('DomainInsert', array('name' => $params), 'urn:SedoInterface'); // Check for a fault if ($client->fault) { // Error Code echo "Faultcode: ".$result['faultcode']."<br>"; // Error description echo "Faultstring: ".$result['faultstring']."<br>"; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo $err; } else { // Display the result echo "<table border=1>"; echo "<tr><td>Domain</td><td>Status</td><td>Message</td></tr>"; for($i = 0; $i<count($result); $i++) { echo "<tr><td>".$result[$i]['domain']."</td><td>".$result[$i]['status']."</td><td>".$result[$i]['message']."</td></tr>"; } echo "</table>"; } } ?>
  7. Hi premiso - that worked brilliant (don't worry about the somethingelses!) Only problem is, each line has a space appended to the end and that's failing the next step. How can I get rid of that space? Cheers simon
  8. Sorry, I think I probably confused things by cutting down my code. There's a whole load of other things that have to go inside each: $arrayofdomainentries[] = array( // first element 'domain' => $domain, 'language' => 'en', 'somethingelse' => 'xx', 'somethingelse' => 'xx', ); How would I do it now?! Cheers Simon
  9. Hi, At the moment I have a simple textbox on an HTML form and I get the content in a PHP file like so: <input name="domain" type="text" value="testdomain.co.uk" /> <?PHP //Get input $domain = $_POST['domain']; ?> But I would like to be able to have a textarea where multiple entries can be made eg: testdomain1.co.uk testdomain2.co.uk testdomain3.co.uk etc How would I get that input into my PHP script so I could do this: $arrayofdomainentries[] = array( // first element 'domain' => $domain, ); $arrayofdomainentries[] = array( // second element 'domain' => 'xxxx.xxx', ); $arrayofdomainentries[] = array( // third element 'domain' => 'xxxx.xxx', ); and so on! I'm sure this quite simple but I've never dealt with multiples before (I think they're call arrays?!) Cheers Simon
  10. Ah - thanks gaza165 and gevans. Works brilliantly Cheers Simon
  11. Thanks gaza165 Would that be ok if www. didn't exist in the input too? Simon
  12. I have a form input as: $domain = $_POST['domain']; . . . but I need to check the string to see if it starts with 'www.' and if it does, remove it. How would I go about this? Cheers Simon
  13. This worked a treat - I knew it was something simple Thanks all. Simon
  14. not really sure! What I don't get is how PHP knows what any of them are as they are passed from a form??
  15. We trying to stop using register_globals but this code we have doesn't work without it. What would we need to change? // only validate form when form is submitted if(isset($submit_button)){ $error_msg=''; if($pagerName=='') { $error_msg.="<li>Please tell us your name</li>"; } if($pagerPhone=='') { $error_msg.="<li>Please tell us telephone number</li>"; } Thanks! Simon
  16. Thanks thorpe - I've done some googling and come up with: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.xxx.com/login.php?goto=clientarea"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$username&password=$password"); curl_exec ($ch); curl_close ($ch); . . . but I just end up with a blank page where as I need it to go to the logged in page (which is what I thought the followlocation line did). Any ideas? Cheers Simon
  17. Hi, I need to 'log people in' using php code - ie using a form I would do: <form name="login" action="https://www.xxx.com/login.php?goto=clientarea" method="POST" target="_blank"> <input type="hidden" name="username" size="20"> <input type="hidden" name="password" size="20"> </form> . . . but I need to be able to automatically submit that information from within php - does that make sense? Any tips on how to do that? I thought I might need cURL but not sure if that's right. Cheers Simon
  18. Cheers Dj Kat - I did read that but didn't understand it Can you give me a pointer? Cheers Simon
  19. Hi, Firstly, I'm not a javascript programmer! I've got two scripts running on a page, one using the jquery library and the other using the prototype library. Problem is, they're clashing with each other. I can get one or the other working by putting the script link in front of the other but can't get them both working together. Anyone able to help? I've looked at http://docs.jquery.com/Using_jQuery_with_Other_Libraries but it's all goblidook! Cheers Simon
  20. Thanks ProjectFear (and everyone else) - that worked brilliantly. Simon
  21. Thanks dropfaith - I'm now seeing the error: Any ideas? The SQL looks good to me! Cheers Simon
  22. ok - thanks guys - i'll do some googling. cheers simon
  23. Thanks - but that really doesn't help much! Can you expand?
  24. Hi folks, I have some code that checks if a server is online. I want the code to check continually (ie every 1 second) - I know I could use a meta refresh but that's a bit clunky. Is there a way I can setup a loop around the code that would do it more cleanly that meta refresh? Hope this makes sense and someone can help! Cheers Simon
×
×
  • 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.