----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[email protected]> Sent: Tuesday, September 04, 2007 12:50 PM Subject: Re: [php-list] callinh a Skype account withing a PHP script?
----- Original Message ----- From: "Andrew O'Brien" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Tuesday, September 04, 2007 6:15 AM Subject: [php-list] callinh a Skype account withing a PHP script? One of my php scripts is a basic chat page where users point their browser, enter their info (name and email address, etc) via a cookie (info.php) and post lines of text. When they enter their email address, their name appears on my page with an hype text link that contains a mailto command (javascript). The two associated line appear to be locationstring = "mailto:" + user + "@" + domain + subject; window.location = locationstring; and... if($atsign != 0) { $emailbox = substr($thisline[2], 0, $atsign); $emailhost = substr($thisline[2], $atsign+1); $callstring = "<a href=\"javascript:mailto('".$emailbox."','".$emailhost."','')\">".$thisline[1]."</a>"; } I was toying with the idea of getting rid of the command to invoke a "mailto" command and instead insert a command that would place a Skype call. That command (for my andyobrien73 account ) is skype:andyobrien73?call Anyone any idea how I would modify the original PHP to get rid of email and add Skype? Andy ------------------------------ Hello Andy, I don't use Scype but I recognise the URL format. If you change the following ... if($atsign != 0) { $emailbox = substr($thisline[2], 0, $atsign); $emailhost = substr($thisline[2], $atsign+1); $callstring = "<a href=\"javascript:mailto('".$emailbox."','".$emailhost."','')\">".$thisline[1]."</a>"; } Change to .... if($atsign != 0) { $callstring = '<a href="skype:' . $thisline[2] . '?call">' . $thisline[1]."</a>"; } Then it should work as you expect once you change the email addresses to scype address ie... email name = Andy Obrien email address = andyobrien73 --------------------------------- Andy, I re-read the code I sent and it is wrong if($thisline[2] != "") { $callstring = '<a href="skype:' . $thisline[2] . '?call">' . $thisline[1]."</a>"; } this still may have an issue depending on how $thisline is set perhaps if((isset($thisline) && (($thisline[2] != "")) { $callstring = '<a href="skype:' . $thisline[2] . '?call">' . $thisline[1]."</a>"; } PS: delete the unwanted white space in this email code
