Jump to content

ryanschefke

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ryanschefke's Achievements

Member

Member (2/5)

0

Reputation

  1. Sorry, I must correct my last post: http://www.leadliaison.com/phpinfo.php -COMPARED TO- the same script under https, https://www.leadliaison.com/phpinfo.php. I am sure you figured that out though. The main issue seems to be that $_SERVER["HTTP_X_FORWARDED_FOR"] passes through under http but that server variable does not show up under https. I will chat with our server admin team about getting the $_SERVER["HTTP_X_FORWARDED_FOR"] header passed through with the https request. Open to other ideas in the interim...
  2. Hi Folks - I used the phpinfo() approach and ran it under http and https. To prove my point, check this out: http://www.leadliaison.com/phpinfo.php -COMPARED TO- the same script under https, http://www.leadliaison.com/phpinfo.php. At the end you will see the server variables. It does not report the remote IP under https. Is there a solution here to collect the IP under https?
  3. It displays the remote IP address of the server hosting our website when $_SERVER['REMOTE_ADDR']; runs under https. However, when $_SERVER['REMOTE_ADDR']; runs under http it displays the remote IP address of a visitor accessing our website.
  4. Hello, I am trying to collect an IP address using PHP over both http and https connections. Does anyone know how I can collect the IP over https? I use the $ip = $_SERVER['REMOTE_ADDR']; ...over http and it works just fine. However, when I use it over https it does not. Thank you very much, Ryan
  5. Hello, I am looking for someones services to help me properly complete setup of my e-mail server. I am running Interspire's E-mail Marketer application on the server which will be used by my customers to send e-mail campaigns (newsletters, etc). I anticipate 1,000s of e-mails will be leaving the server and I want to avoid getting blacklisted, added to spam lists, etc. The software package itself takes a number of steps to control these measures; however, I understand DKIM, SenderID, SPF records and proper DNS configuration are also vital. If you can provide services please feel free to call my mobile phone at 214.491.0807 as there is a good chance I will not be checking the e-mail account associated with this forum over the next few days. Thanks, Ryan
  6. Hello, Is there a way to limit the size of a string returned from a select statement? For example, it is a long URL but I only want to display the first 50 characters. The way I am using the select statement in a particular section of code doesn't allow for any post processing so I need to format the string inside the select statement. Thank you, Ryan
  7. Hello, How can I construct this query? I have a bunch of values in a table. I want to output the % of values that only occur once to the % of values that occur more than once. In other words, if I have 1, 2, 2, 2, 3, 4, 4, I would like to output: New numbers: 50% Existing numbers: 50% ..new numbers because the 1 and 3 only occurred once and existing numbers of 2 and 4 because they occurred more than once. %s are %s of individual numbers. What is the query I should use? Ryan
  8. Hello - I am trying to count the number of rows in my "visitors" table. When I add the lines "filter_countries.filterID='57' AND v.country!=filter_countries.country_code" it miscalculates the numbers. I have a "country" column in the visitors table and I only want to count the rows that do not have the same "country" value as rows in my "filter_countries" table with "filterID='57". My attempt at the query is below. What am I doing wrong? SELECT COUNT(v.visitorID), DATE_FORMAT(DATE_SUB(v.dateTime,INTERVAL 5 HOUR), '%a %c/%e/%y') as visitsOnDate, v.dateTime, cast(DATE_SUB(v.dateTime,INTERVAL 5 HOUR) as date) as groupDate FROM visitors as v , filter_countries WHERE v.customerID='11222' AND cast(DATE_SUB(v.dateTime,INTERVAL 5 HOUR) as date) BETWEEN '2008-09-22' AND '2008-09-29' AND filter_countries.filterID='57' AND v.country!=filter_countries.country_code GROUP BY groupDate ORDER BY v.dateTime DESC Thank you very much, Ryan
  9. Hello - I would like to make a single PHP page that aggregated news clips from RSS feeds I suppose, and listed them on a page. Does anyone have examples, code, etc to accomplish this? For example, I would want to see all news clips for Cisco for the past 30 days. Thanks, Ryan
  10. Hello, I am playing with an API from a company that makes a SOAP request and an XML response is sent back. I am not sure how to use/interpret the response and need some help. You can see the output here: http://www.leadliaison.com/test_hooversAPI.php. The script is below, which dumps this output on the above link to the screen. For now, I just want to print something simple like annual sales, which according to the providers API has the XML output parameters of: \return\resultSet\hit\company-results\finsales <form method="post" action="test_hooversAPI.php"> <table border=0> <tr> <td> <input type="radio" name="methodName" value="FindCompanyByKeyword">FindCompanyByKeyword </td> </tr> <tr> <td> <input type="radio" name="methodName" value="AdvancedCompanySearch">AdvancedCompanySearch </td> </tr> <tr> <td> <input type="radio" name="methodName" value="GetCompanyDetail">GetCompanyDetail </td> </tr> <tr> <td> <input type="radio" name="methodName" value="GetAdvancedSearchLookups">GetAdvancedSearchLookups </td> </tr> <tr> <td> <input type="radio" name="methodName" value="GetPersonDetail">GetPersonDetail </td> </tr> <tr> <td> <input type="radio" name="methodName" value="AdvancedPersonSearch">AdvancedPersonSearch </td> </tr> <tr> <td> <input type="radio" name="methodName" value="FindPersonByKeyword">FindPersonByKeyword </td> </tr> <tr> <td> <input type="submit" value="Submit"> </td> </tr> </table> </form> <br/> <hr/> <br/> <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { print($_POST['methodName']); try { //Create your SoapClient and point to Hapi.wsdl $client = new SoapClient( 'http://hapi-dev.hoovers.com/axis2/Hapi.wsdl', array('trace' => true, 'exceptions' => true) ); //Create the SoapHeader once //The header contains your API KEY $apiKeySoapHeader = new SoapHeader('http://webservice.hoovers.com', 'API-KEY', 'MYKEYHERE'); //Call the chosen web service if($_POST['methodName'] == 'FindCompanyByKeyword') { //Create find company by keyword params $parameters = array( "keyword" => 'Hoover\'s Inc' ); } elseif($_POST['methodName'] == 'AdvancedCompanySearch') { //Search for companies that have 10 to 100 employees in Dallas $parameters = array( "bal" => array( "companysize" => array( "employeesFrom" => 10, "employeesTo" => 100 ), "location" => array( "city" => 'Dallas' ) ) ); } elseif($_POST['methodName'] == 'GetCompanyDetail') { $parameters = array( "uniqueId" => '809194728' ); } elseif($_POST['methodName'] == 'GetPersonDetail') { $parameters = array( "uniqueId" => '2059663' ); } elseif($_POST['methodName'] == 'AdvancedPersonSearch') { $parameters = array( "bal" => array( "companysize" => array( "employeesFrom" => 10, "employeesTo" => 100 ), "location" => array( "city" => 'Dallas' ) ) ); } elseif($_POST['methodName'] == 'FindPersonByKeyword') { $parameters = array( "keyword" => 'Hoover\'s' ); } elseif($_POST['methodName'] == 'GetAdvancedSearchLookups') { //TODO: Might need to be NULL...wait until new version of HAPI goes to SoDevHAPI $parameters = array(); } //Use __soapCall instead of directly calling the method, //as we must pass the API-KEY in the Header $result = $client->__soapCall($_POST['methodName'], array($parameters), NULL, $apiKeySoapHeader); //Now that you have the result data, use it //The data will come back as an object using the names defined in the WSDL dump($result); //echo $industries->return['sIAC']; //echo $result['return']['industries']['sIAC']; //echo "Name: " . $result->return->keyNumbers->fiscal-period . "\n"; //TEMP var_dump($result->return->resultSet); } catch (Exception $e) { print($e); print($client->__getLastRequest()); } } ?> <?php ///////////////// // Much thanks to the group on php.net // Specific code taken from http://us3.php.net/manual/en/function.var-dump.php#80288 //////////////// //////////////////////////////////////////////////////// // Function: dump // Inspired from: PHP.net Contributions // Description: Helps with php debugging function dump(&$var, $info = FALSE) { $scope = false; $prefix = 'unique'; $suffix = 'value'; if($scope) $vals = $scope; else $vals = $GLOBALS; $old = $var; $var = $new = $prefix.rand().$suffix; $vname = FALSE; foreach($vals as $key => $val) if($val === $new) $vname = $key; $var = $old; echo "<pre style='margin: 0px 0px 10px 0px; display: block; background: white; color: black; font-family: Verdana; border: 1px solid #cccccc; padding: 5px; font-size: 10px; line-height: 13px;'>"; if($info != FALSE) echo "<b style='color: red;'>$info:</b><br>"; do_dump($var, '$'.$vname); echo "</pre>"; } //////////////////////////////////////////////////////// // Function: do_dump // Inspired from: PHP.net Contributions // Description: Better GI than print_r or var_dump function do_dump(&$var, $var_name = NULL, $indent = NULL, $reference = NULL) { $do_dump_indent = "<span style='color:#eeeeee;'>|</span> "; $reference = $reference.$var_name; $keyvar = 'the_do_dump_recursion_protection_scheme'; $keyname = 'referenced_object_name'; if (is_array($var) && isset($var[$keyvar])) { $real_var = &$var[$keyvar]; $real_name = &$var[$keyname]; $type = ucfirst(gettype($real_var)); echo "$indent$var_name <span style='color:#a2a2a2'>$type</span> = <span style='color:#e87800;'>&$real_name</span><br>"; } else { $var = array($keyvar => $var, $keyname => $reference); $avar = &$var[$keyvar]; $type = ucfirst(gettype($avar)); if($type == "String") $type_color = "<span style='color:green'>"; elseif($type == "Integer") $type_color = "<span style='color:red'>"; elseif($type == "Double"){ $type_color = "<span style='color:#0099c5'>"; $type = "Float"; } elseif($type == "Boolean") $type_color = "<span style='color:#92008d'>"; elseif($type == "NULL") $type_color = "<span style='color:black'>"; if(is_array($avar)) { $count = count($avar); echo "$indent" . ($var_name ? "$var_name => ":"") . "<span style='color:#a2a2a2'>$type ($count)</span><br>$indent(<br>"; $keys = array_keys($avar); foreach($keys as $name) { $value = &$avar[$name]; do_dump($value, "['$name']", $indent.$do_dump_indent, $reference); } echo "$indent)<br>"; } elseif(is_object($avar)) { echo "$indent$var_name <span style='color:#a2a2a2'>$type</span><br>$indent(<br>"; foreach($avar as $name=>$value) do_dump($value, "$name", $indent.$do_dump_indent, $reference); echo "$indent)<br>"; } elseif(is_int($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color$avar</span><br>"; elseif(is_string($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color\"$avar\"</span><br>"; elseif(is_float($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color$avar</span><br>"; elseif(is_bool($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $type_color".($avar == 1 ? "TRUE":"FALSE")."</span><br>"; elseif(is_null($avar)) echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> {$type_color}NULL</span><br>"; else echo "$indent$var_name = <span style='color:#a2a2a2'>$type(".strlen($avar).")</span> $avar<br>"; $var = $var[$keyvar]; } } ?>
  11. Hello, I have a table and some of the rows has an empty value in one of the columns. It is blank (in other words, it is not "NULL"). How do I only select the rows that have a value and are not empty. The SELECT WHERE value IS NOT NULL doesn't work, and I understand why since I am putting in blank values. Thanks! Ryan
  12. Hello, I am trying to only show the rows where the sumHits value is >1 and it is not working. I confirmed if I remove the "sumHits>1" (currently in below query) it works just fine. Thanks in advance for your help. SELECT v.organization, v.city, v.region, countries.printable_name, DATE_FORMAT(v.dateTime, '%m/%d/%Y %l:%i %p'), v.visitorID, v.searchWords, COUNT(h.hitID) as sumHits FROM visitors as v, hits as h, countries WHERE v.customerID='11222' AND cast(v.dateTime as date)='2008-08-30' AND h.visitorID=v.visitorID AND v.country=countries.country_code AND sumHits>1 GROUP BY h.visitorID ORDER BY v.dateTime DESC LIMIT 0, 20
  13. My full script is below. When the form is submitted I want to store all the selected values in MySQL. To test, I am trying to just print them to the screen. I can't figure out how to pass the selected items values in the submission form to print. You can see it in action here: http://www.leadliaison.com/filterState.php <?PHP require_once ("mysql_connect.php"); // connect to the db include "configuration.inc"; //require_once ("passport.php"); // connect to the db if (isset($submit)) { for ($n=0; $n <= count($_POST['1stLeft']); $n++) { //echo "hi".$i; echo $_POST['1stLeft'][$n]; echo "<br>"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Lead Liaison - Sales Leads</title> <link href="CSS/ll_main.css" rel="stylesheet" type="text/css" /> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <script type="text/javascript"> function OnTransferBtnClick(blnFromLeft) { var LeftListBox = document.forms[0].lstLeft; var RightListBox = document.forms[0].lstRight; var ListItems = new Array(); FromList = (blnFromLeft ? LeftListBox : RightListBox); ToList = (blnFromLeft ? RightListBox : LeftListBox); for(var i=(FromList.options.length - 1);i>=0;i--) if(FromList.options[i].selected) { ListItems[ListItems.length] = new Option(FromList.options[i].text); FromList.options[i] = null; } for(var i=ListItems.length - 1;i>=0;i--) ToList.options[ToList.options.length] = ListItems[i]; } </script> </head> <body> <div id="container"> <?PHP include "header_internal.php";?> <?php if (isset($message)) { echo '<table width="90%" border="0" align="center"><tr> <td class="rederrormessage"> <div align="center"><img src="images/icon_critalert.gif" width="34" height="34" hspace="10" vspace="5" align="absmiddle" />'.$message.' </div></td> </tr></table>'; } if (isset($success)) { echo '<table width="90%" border="0" align="center"><tr> <td class="successmessage"> <div align="center"><img src="images/icon_confirmation.gif" width="34" height="34" hspace="10" vspace="5" align="absmiddle" />'.$success.' </div></td> </tr></table>'; } ?> <table border="0" align="center" > <tr> <td height="295"> <div align="center"> <div class="containerGrey"> <!-- Container Head --> <div class="container_headGrey"> <img src="images/sidebar_leftSquare.jpg" alt="" class="float_left"/> <img src="images/sidebar_rightSquare.jpg" alt="" class="float_right"/> <div class="container_head_textGrey"> <div align="left"> Choose States and Provinces</div> </div> </div> <!-- Container Content --> <div class="container_contentGrey"> <div align="center"> <form action="<?PHP echo $PHP_SELF; ?>" method="post" name="statesform" id="statesform"> <table width="70%"> <tr> <td height="181"> <!--<select name="lstLeft" multiple size="10"> --> <?PHP $query_getstates = "SELECT state_code, state_name FROM states"; $result_getstates = @mysql_query($query_getstates); // run the query echo "<select name=\"lstLeft\" size=\"10\" multiple>"; while ($row_getstates = mysql_fetch_array($result_getstates, MYSQL_NUM)) { echo "<option value=\"" . $row_getstates[0] . "\">" . $row_getstates[1] . "</option>"; } ?> </select></td> <td> &nbsp </td> <td> <table> <tr> <td> <input Type="Button" Name="btnLtoR" Value=">>" onclick="OnTransferBtnClick(true)" title="Transfer Items Selected in the Left List Box to the Right List Box"> </td> </tr> <tr> <td> <input Type="Button" Name="btnRtoL" Value="<<" onclick="OnTransferBtnClick(false)" title="Transfer Items Selected in the Right List Box to the Left List Box"> </td> </tr> </table> </td> <td> &nbsp </td> <td> <select name="lstRight" MULTIPLE size="10"> </select> </td> </tr> </table> <table width="100%" border="0"> <tr> <td><div align="center"> <input name="submit" type="submit" id="submit" title="Submit this form" value="OK" /> </div></td> </tr> <tr> <td> </td> </tr> </table> </form> </div> </div> </div> </div> </td> </tr> </table> <p> <?PHP mysql_close(); ?> </p> <p> </p> <?PHP include "footer.php"; ?> </div> </body> </html>
×
×
  • 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.