PHP - About 2:1 Banner Exchange Sites And Bots
Hi, I making a banner exchange script. Members will have to place a banner code on their sites to make banners appear. Some members might cheat by using bots to refresh the page to gain impressions and to waste other members impressions so i wanted to know if bots have ip addresses? because i want to only give member impressions if their visitors have ip. What are the other things i can do to check if members are cheating?. Thanks
$ip=$_SERVER['REMOTE_ADDR']; Similar TutorialsHello, i am reading about bots and forms and using hidden input fields. I read that bots can be programmed to ignore hidden fields, so i made a text input named email and i use css to display none. i am having trouble detecting the email input. i've tried if (!empty($_POST['email'])) { echo 'test'; exit; } but i see 'test' on submission. if i add value="0" i still see test displayed. if i add text then i still see test displayed. why is this not working? also, a zero seems to bypass empty(). i'm not able to understand why this is failing. Hello, I'm using this plain and simple script below to count page views. Is there a way to identify a spider bot with php and then do something like.. if this visitor is a bot, don't count it. If not, count it? Here's my simple script: Code: [Select] $querySelect = mysql_query("SELECT * FROM video WHERE video.id = '$_GET[id]'"); $rowcount = mysql_fetch_assoc($querySelect); $count = $rowcount['counter']; if (empty($count)) { $counter = 1; $insert = mysql_query("INSERT INTO video (counter) VALUES ($counter) WHERE video.id = '$_GET[id]'"); } $add = $count+1; $insertNew = mysql_query("UPDATE video SET counter='$add' WHERE video.id = '$_GET[id]'"); thanks, Ryan if I have a list of 5,000 bots and their server header into in my DBs, can someone point me to a web resource that can give me any insight into how to show a custom page if a bot is detected at the render request? I can look up PHP functions myself and possibly use header(), but didn’t know if anything special was involved that I don’t already know about. so, say for instance, as a joke I want to do this: <?php $ip = gethostbyaddr($_SERVER['REMOTE_ADDR']); if (substr($ip, 0, 3) = '10.') { echo 'sorry, but we do not display content to USA government's automated server sniffing bots.'; } ?> how much of a pain in the rear would it be to display custom pages for ‘‘x’’ number of automated hits? I realize that this is pointless because most are just from researching orgs the world over, but it IS a relevant question to ask. thanks. Is there any way to prevent bots from getting past a math captcha? I have 2 numbers generated randomly (from 1 to 20) and they are displayed in an image with the following lines: one going from the upper left corner to the lower right corner one going from the upper right to the lower left a vertical line in the middle of the image and a horizontal line in the middle.... Now I keep getting bots posting on my comments page every few weeks...is there a more effective method I should try in order to stop this? I have the answer stored in a session variable. I was going to try random numbers from (1 to 100). I also have a php counter on my webpage that has a file that the number of hits is written to and it seems everytime the bots post get past my captcha, the number of hits in the file is overridden. (It will go from 538 views down to 10 views).... Any ideas??? Hello every1,
I'm trying to create a magazine wesite and I dont want anybody to access my images folder which is located in the root directory.
I want some thing like this...
I want to call the images in my website using <img> tag but I dont want any1 to access the directory directly.
It should also protect from software bots also like (HTTrack or website Copier)
It should show "Access forbidden".
Any help will be greatly appreciated.
Thank you...
Hello We have a series of sites that use Google API to serve locations stored in local DB, that show google maps from within given PHP pages within our sites (these pages also have other db driven content we wish to keep.... Each 'member' in our sites, they each have a google map shown on each page present for their 'location' menu tab... These calls to the google map API, often goes over our daily allotment of freebie map presentations from the google API It is SE and other Bots that run these view numbers off the charts and prevent the google maps from loading the actual maps - we get a google map err message - advising that maximum views have been reached... (we see this in our server error logs) Thoughts on how i can serve this map code to only legit http requests (human eyes) or at least reduce the burden of bot crawl requests to the google API? here is the code we use to call the maps - We need to encapsulate Google Map Display in a snippet that will block it from getting hit by bots.... Huge Thanks! Code: [Select] <form target="_blank" method="GET" action="http://maps.google.com/maps"> <input type="hidden" name="daddr" value="<? echo "$address, $city, $state $zip $country" ?>"> <?php display_tooltip("Please enter your starting point in the form address, city, state zip country or simply enter your city", "mapdir");?> <input type="text" name="saddr" value="your starting point" onfocus=this.select()> <input class="clickableL" type="submit" value="Map and Directions"> </form> Hi guys, New to PHP but learning every day. This is probably a really newbie error but I've tried multiple different ways and can't get it to work. $tableData = ''; if(mysql_num_rows($result)==0) { $tableData = "<tr><td colspan=\"4\">No results returned.</td></tr>\n"; } else { while($row = mysql_fetch_assoc($result)) { $tableData .= " <tr bgcolor='#FFFFFF' align='center'>\n"; $tableData .= " <td>{$rank}</td>\n"; $tableData .= " </tr>\n"; $rank = ($row['rank']); if ($rank == 0) { print "Cadet"; } if ($rank == 1) { print "Sergeant"; } if ($rank == 2) { print "2nd Lieutenant"; } if ($rank == 3) { print "1st Lieutenant"; } if ($rank == 4) { print "Captain"; } if ($rank == 5) { print "Major"; } if ($rank == 6) { print "Lt. Colonel"; } if ($rank == 7) { print "Colonel"; } } } ?> <table class="tables" cellspacing="0" cellpadding="0"> <tr> <th>Rank</th> </tr> <?php echo $tableData; ?> </table> When this script is run the $rank variable shows the numbers 1,2,3,4,5,6,7 instead of the textual translations for example if 0 is displayed then "cadet" should be shown instead. The current script shows the numbers in the table but prints the accurate translations at the top outside the table tag..... Can anyone show me what I've done wrong here? Thank you in advance. Hello, I have tried to figure it out on my own for two months, but just don't get it. My goal is to have automated data exchange to my e-shop. It is in Estonian. http://www.elnetsec.ee/pood/ And the place I have to get the data from is a e-shop called Acme. acc.acme.lt All they gave me was a php document and told me to use it. I'll copy it here, so maybe someone can give me advice, which lines do I have to add and which to change. <?php class Filter { public $Name; public $Value; } class ArrayOfFilter { public $Filter; } class GetProductListRequest { public $Filters; } class GetProductList { public $GetProductListRequest; } class GetInvoiceListRequest { public $Filters; } class GetInvoiceList { public $GetInvoiceListRequest; } class GetInvoiceDetailsRequest { public $Filters; } class GetInvoiceProductSerialList { public $GetInvoiceProductSerialListRequest; } class GetInvoiceProductSerialListRequest { public $Filters; } class GetInvoiceDetails { public $GetInvoiceDetailsRequest; } class GetProductSpecification { public $GetProductSpecificationRequest; } class GetProductSpecificationRequest { public $Filters; } class GetProductResourcesRequest { public $Filters; } class GetProductResources { public $GetProductResourcesRequest; } class GetProductBarcodeList { public $GetProductBarcodeListRequest; } class GetProductBarcodeListRequest { public $Filters; } class GetAddressList { public $GetAddressListRequest; } class GetAddressListRequest { public $Filters; } class GetCustomerUserList { public $GetCustomerUserListRequest; } class GetCustomerUserListRequest { public $Filters; } class GetInvoiceShipments { public $GetInvoiceShipmentsRequest; } class GetInvoiceShipmentsRequest { public $Filters; } class GetOrderDetails { public $GetOrderDetailsRequest; } class GetOrderDetailsRequest { public $Filters; } class PurchaseProducts { public $PurchaseProductsRequest; } class PurchaseProductsRequest { public $Filters; public $PurchaseLines; } class ProductPurchaseLine { public $ProductPurchaseLineId; public $SupplierCode; public $Quantity; public $DeliveryTypeId; public $DeliveryAddress; public $Note; } class Address { public $AddressId; public $Street; public $City; public $PostalCode; public $CountryCode; } class AcmeAPI { public $licenseKey = '498ec72c-e8e7-48f2-b300-d95666aeb141'; private $soapClient = null; private $soapHeader = null; private $wsdl = 'https://api.acme.lt/1.0/commerce.asmx?WSDL'; private function init () { $map = array( "Filter"=>"Filter", "ArrayOfFilter" => "ArrayOfFilter", "GetProductListRequest"=>"GetProductListRequest", "GetProductList"=>"GetProductList", "GetInvoiceList"=>"GetInvoiceList", "GetInvoiceListRequest"=>"GetInvoiceListRequest", "GetProductSpecification"=>"GetProductSpecification", "GetProductSpecificationRequest"=>"GetProductSpecificationRequest", "GetProductResources"=>"GetProductResources", "GetInvoiceDetails"=>"GetInvoiceDetails", "GetInvoiceDetailsRequest"=>"GetInvoiceDetailsRequest", "GetInvoiceProductSerialList"=>"GetInvoiceProductSerialList", "GetInvoiceProductSerialListRequest"=>"GetInvoiceProductSerialListRequest", "GetAddressList" => "GetAddressList", "GetAddressListRequest" => "GetAddressListRequest", "GetCustomerUserList" => "GetCustomerUserList", "GetCustomerUserListRequest" => "GetCustomerUserListRequest", "GetInvoiceShipments" => "GetInvoiceShipments", "GetInvoiceShipmentsRequest" => "GetInvoiceShipmentsRequest", "GetOrderDetails" => "GetOrderDetails", "GetOrderDetailsRequest" => "GetOrderDetailsRequest", "PurchaseProducts" => "PurchaseProducts", "PurchaseProductsRequests" => "PurchaseProductsRequest", "ProductPurchaseLine" => "ProductPurchaseLine", "DeliveryAddress" => "Address" ); $this->soapClient = new SoapClient($this->wsdl,array('classmap'=> $map ,'trace' => 1, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS )); $this->soapHeader = new SoapHeader('http://schemas.acme.eu/', 'LicenseHeader', array('LicenseKey'=>$this->licenseKey), false); $this->soapClient->__setSoapHeaders(array($this->soapHeader)); } public function getVendors() { try { $this->init(); $result = $this->soapClient->GetVendorList(); foreach ($result->GetVendorListResult->VendorList->Vendor as $b) { print $b->VendorId." ".$b->VendorName."<br />"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getInvoiceList() { try { $this->init(); $request = new GetInvoiceListRequest(); $request->Filters = new ArrayOfFilter(); $datefrom = new Filter(); $datefrom->Name = "InvoiceDateFrom"; $datefrom->Value= "2008.01.01"; $dateTo = new Filter(); $dateTo->Name = "InvoiceDateTo"; $dateTo->Value = "2009.03.16"; $parameters = $request->Filters->Filter = array( $datefrom,$dateTo); $params = new GetInvoiceList(); $params->GetInvoiceListRequest = $request; $result = $this->soapClient->GetInvoiceList($params); if(isset($result->GetInvoiceListResult->InvoiceHeaderList->InvoiceHeader)) { foreach ($result->GetInvoiceListResult->InvoiceHeaderList->InvoiceHeader as $inv) { print $inv->InvoiceNumber." ".$inv->InvoiceDate."</br>"; } } else { print "no invoices found"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getInvoiceDetails() { try { $this->init(); $request = new GetInvoiceDetailsRequest(); $request->Filters = new ArrayOfFilter(); $invoice = new Filter(); $invoice->Name = "InvoiceNumber"; $invoice->Value= "ACC-01722223"; $parameters = $request->Filters->Filter = array($invoice); $params = new GetInvoiceDetails(); $params->GetInvoiceDetailsRequest = $request; $result = $this->soapClient->GetInvoiceDetails($params); foreach ($result->GetInvoiceDetailsResult->InvoiceList as $inv) { print $inv->InvoiceHeader->InvoiceNumber." ".$inv->InvoiceHeader->InvoiceDate."</br>"; foreach($inv->InvoiceLine as $line) { print $line->SupplierCode." | ".$line->ShortName." | ".$line->LineAmount."<br />"; } } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getInvoiceProductSerials() { try { $this->init(); $request = new GetInvoiceProductSerialListRequest(); $request->Filters = new ArrayOfFilter(); $invoice = new Filter(); $invoice->Name = "InvoiceNumber"; $invoice->Value= "ACC-00761335"; $parameters = $request->Filters->Filter = array($invoice); $params = new GetInvoiceProductSerialList(); $params->GetInvoiceProductSerialListRequest = $request; $result = $this->soapClient->GetInvoiceProductSerialList($params); foreach ($result->GetInvoiceProductSerialListResult->ProductSerialList->ProductSerial as $ps) { print $ps->SupplierCode." ".$ps->SerialNumber."</br>"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getProductSpecification() { try { $this->init(); $request = new GetProductSpecificationRequest(); $request->Filters = new ArrayOfFilter(); $language = new Filter(); $language->Name = "Language"; $language->Value= "en-us"; $product = new Filter(); $product->Name = "SupplierCode"; $product->Value= "032016"; $parameters = $request->Filters->Filter = array($language, $product); //$parameters = $request->Filters->Filter = array($language); $params = new GetProductSpecification(); $params->GetProductSpecificationRequest = $request; $result = $this->soapClient->GetProductSpecification($params); foreach ($result->GetProductSpecificationResult->ProductSpecification as $spec) { print $spec->SupplierCode." "; foreach($spec->ProductProperty as $property) { print $property->PropertyName.": ".$property->PropertyValue."<br />" ; } } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getProductResources() { try { $this->init(); $request = new GetProductResourcesRequest(); $request->Filters = new ArrayOfFilter(); $language = new Filter(); $language->Name = "Language"; $language->Value= "en-us"; $product = new Filter(); $product->Name = "SupplierCode"; $product->Value= "025348"; $parameters = $request->Filters->Filter = array($language, $product); //$parameters = $request->Filters->Filter = array($language); // all resources will be returned if no product filter supplied $params = new GetProductResources(); $params->GetProductResourcesRequest = $request; $result = $this->soapClient->GetProductResources($params); foreach ($result->GetProductResourcesResult->ProductResources as $res) { print $res->SupplierCode." "; if(isset($res->ProductResource)) { foreach($res->ProductResource as $r) { print $r->ResourceName.": ".$r->ResourceURL."<br />" ; } } } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getProductBarcodes() { try { $this->init(); $request = new GetProductBarcodeListRequest(); $params = new GetProductBarcodeList(); $params->GetProductBarcodeListRequest = $request; $result = $this->soapClient->GetProductBarcodeList($params); if($result->GetProductBarcodeListResult->ProductBarcodeList->ProductBarcode) { foreach ($result->GetProductBarcodeListResult->ProductBarcodeList->ProductBarcode as $b) { print $b->SupplierCode." ".$b->Barcode."<br />"; } } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getProductClassification () { try { $this->init(); $result = $this->soapClient->GetProductClassification(); // segments print "Segments list:<br />"; foreach ($result->GetProductClassificationResult->SegmentList->Segment as $b) { print $b->SegmentId." ".$b->SegmentName."<br />"; } print "-----------------------------------------------<br />"; // Groups print "Group list:<br />"; foreach ($result->GetProductClassificationResult->GroupList->Group as $b) { print $b->GroupId." ".$b->GroupName."<br />"; } print "-----------------------------------------------<br />"; // Classes print "Class list:<br />"; foreach ($result->GetProductClassificationResult->ClassList->Class as $b) { print $b->ClassId." ".$b->ClassName."<br />"; } print "-------------------------------------------------<br />"; // Series print "Series list:<br />"; foreach ($result->GetProductClassificationResult->SeriesList->Series as $b) { print $b->SeriesId." ".$b->SeriesName."<br />"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getProductList () { try { $this->init(); $request = new GetProductListRequest(); $request->Filters = new ArrayOfFilter(); $language = new Filter(); $language->Name = "Language"; $language->Value= "lt-lt"; $currency = new Filter(); $currency->Name = "Currency"; $currency->Value = "LTL"; $request->Filters->Filter = array( $language,$currency); $params = new GetProductList(); $params->GetProductListRequest = $request; $result = $this->soapClient->GetProductList($params); foreach ($result->GetProductListResult->ProductList->Product as $p) { print $p->SupplierCode." ".$p->Name."<br />"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getInvoiceShipments() { try { $this->init(); $request = new GetInvoiceShipmentsRequest(); $request->Filters = new ArrayOfFilter(); $invoice = new Filter(); $invoice->Name = "InvoiceNumber"; $invoice->Value= "ACC-00761335"; // set invoice number here $parameters = $request->Filters->Filter = array($invoice); $params = new GetInvoiceShipments(); $params->GetInvoiceShipmentsRequest = $request; $result = $this->soapClient->GetInvoiceShipments($params); foreach ($result->GetInvoiceShipmentsResult->ShipmentList->Shipment as $ps) { print $ps->CarrierId." ".$ps->Number."</br>"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getOrderDetails() { try { $this->init(); $request = new GetOrderDetailsRequest(); $request->Filters = new ArrayOfFilter(); $parameters = $request->Filters->Filter = array(); $params = new GetOrderDetails(); $params->GetOrderDetailsRequest = $request; $result = $this->soapClient->GetOrderDetails($params); if(isset($result->GetOrderDetailsResult->OrderList->Order)) { foreach ($result->GetOrderDetailsResult->OrderList->Order as $o) { print "OrderId: ".$o->OrderHeader->OrderId." <br />"; foreach($o->OrderLine as $line) { print "OrderLineId: ".$line->OrderLineId." SupplierCode: ".$line->SupplierCode." LineAmount: ".$line->LineAmount." <br />"; } print "----------------------------------------------------<br />"; } } else { print "no orders found"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function purchaseProducts() { try { $this->init(); $request = new PurchaseProductsRequest(); $request->Filters = new ArrayOfFilter(); $request->Filters->Filter = array(); $line = new ProductPurchaseLine(); $line->ProductPurchaseLineId = "demo"; $line->SupplierCode = "003315"; $line->Quantity = 1; $line->DeliveryTypeId = 0; $line->Note = "test order"; $address = new Address(); $address->AddressId = "ecommtest-001"; $line->DeliveryAddress = $address; $request->PurchaseLines = array($line); $params = new PurchaseProducts(); $params->PurchaseProductsRequest = $request; $result = $this->soapClient->PurchaseProducts($params); foreach ($result->PurchaseProductsResult->StatusList->ProductPurchaseStatus as $st) { print $st->ProductPurchaseLineId." ".$st->Status."<br />"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getAddressList() { try { $this->init(); $request = new GetAddressListRequest(); $request->Filters = new ArrayOfFilter(); $request->Filters->Filter = array(); $params = new GetAddressList(); $params->GetAddressListRequest = $request; $result = $this->soapClient->GetAddressList($params); foreach ($result->GetAddressListResult->AddressList->Address as $b) { print $b->AddressId." ".$b->Street." ".$b->City."<br />"; } //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } public function getCustomerUserList() { try { $this->init(); $request = new GetCustomerUserListRequest(); $request->Filters = new ArrayOfFilter(); $request->Filters->Filter = array(); $params = new GetCustomerUserList(); $params->GetCustomerUserListRequest = $request; $result = $this->soapClient->GetCustomerUserList($params); if(isset($result->GetCustomerUserListResult->UserList->User)) { foreach ($result->GetCustomerUserListResult->UserList->User as $b) { print $b->UserId." ".$b->FirstName." ".$b->LastName."<br />"; } } // uncomment this line to see raw result of this method response //echo "<pre>". print_r($result,1) . '</pre>'; } catch(SoapFault $e) { echo '<xmp>' . $this->soapClient->__getLastRequestHeaders() . $this->soapClient->__getLastRequest() . '</xmp>'; echo "<pre>". print_r($e,1) . '</pre>'; } } } $client = new AcmeAPI() ; $client->getVendors(); //$client->getProductClassification(); //$client->getProductList(); //$client->getProductBarcodes(); //$client->getInvoiceList(); //$client->GetInvoiceDetails(); //$client->GetInvoiceProductSerials(); //$client->getProductSpecification(); //$client->getProductResources(); //$client->getAddressList(); //$client->getCustomerUserList(); //$client->getInvoiceShipments(); //$client->getOrderDetails(); //$client->purchaseProducts(); ?> Thanks! Hi .. i have an array format like (mysql result array) $new_array=Array ( [0] => Array ( [quantity] => 5 ) [1] => Array ( [quantity] => 25 ) [2] => Array ( [quantity] => 20 ) ) I have to convert this array into the following format $new_array['quantity'][0]=5 $new_array['quantity'][1]=25 $new_array['quantity'][2]=20 How to convert this array format using any standard array method. $html = @file_get_contents($urlw) or problem('Can\'t open Your Remote URL!'); $html = strtolower($html); $site_url = strtolower($set['site_url']); if (preg_match_all('/<a\s[^>]*href=([\"\']??)([^" >]*?)\\1([^>]*)>/siU', $html, $matches, PREG_SET_ORDER)) { foreach($matches as $match) { if ($match[2] == $set['site_url'] || $match[2] == $set['site_url'].'/') { $found = 1; if (strstr($match[3],'nofollow')) { $nofollow = 1; } break; } } } if ($found == 0) { echo "<center><h2>Our URL Not FOund on your page please submit or check again</h2></center>"; } else next proceggerr.... in $html we getting the content of that page which that user give where he put our link what is this actually this all code is doing infact i was making a link exchange site where on a page people can submit their link for exchange and give their site link and the that page link where they have put our link this code verify at the sPot did they have put our code or not but m facing some problem.. beacuse it's not working good Hello php Freaks, before i start , let me tell you ; BY GOD, i googled, i used countless search functions on several websites and forums, i even called some friends that told me once, they are good with php, but guess what : No Results , AT ALL! So here i am, sorta desperate and hungry for a solution. I need to admit, and somehow its obvious, i am not much of a Programmer, or Coder of some kind. I be more the gfx type of Guy ! Well, here we go : I bought a php Script, and ran a first test on a free web host ( like always ) to check if all looks fine, works well and runs like a charm. And it did. So i went over to my paid space account, bought a domain, and installed the Script on my new domain. All was fine, until i registered a test account. The Script suppose to send an activation email , with an activation link in it. As i said before, on the FREE web space , it worked just fine, even though i entered a gmail Admin Email. (not like i planed to do support@newdomain.com) After a lot of research and 3 re-installations i contacted the Support to tell them that my script dont work on their Server. And here it comes : They don`t allow php Mail for Spamming Reasons. And they are not willing to make an exception. But, they gave me the advice to implement an authenticated smpt script in order to get the job done. The Vendor, is not willing to help me, and i am to much of a php noob to actually know or understand what to do now. Basically i need to know how i pull of a switch from php mail() to authenticate smpt. Here the original Code, with the mail function : Code: [Select] <?php include('header.php'); if(isset($_POST['register'])){ foreach($_POST as $key => $value) { $sec[$key] = filter($value); } $verificare1 = mysql_query("SELECT * FROM `users` WHERE `login`='{$sec['user']}' OR `email`='{$sec['email']}'"); $verificare = mysql_num_rows($verificare1); if ($verificare > 0) { $mesaj = "<div class=\"error\">ERROR: Username or email already registered!</div>"; }else if (!isUserID($sec['user'])) { $mesaj = "<div class=\"error\">ERROR: Username is incorrect!</div>"; }else if(!isEmail($sec['email'])) { $mesaj = "<div class=\"error\">ERROR: Enter a valid email address!</div>"; }else if (!checkPwd($sec['password'],$sec['password2'])) { $mesaj = "<div class=\"error\">ERROR: Passwords do not match!</div>"; }else{ if(isset($_COOKIE['PlusREF'])){ $ref = $_COOKIE['PlusREF']; $user1 = mysql_query("SELECT * FROM `users` WHERE `id`='{$ref}'"); $user = mysql_fetch_object($user1); mysql_query("INSERT INTO `referals`(user,referal,date) values('{$user->login}','{$sec['user']}',NOW())"); } $activare = rand(000000000, 999999909); mail($sec['email'],"Activate your account"," Hello, Thank you for your signup on our site. Click on this link to activate your account: {$site->site_url}/activate.php?cod={$activare} Best Regards!","From: Site Admin <{$site->site_email}>"); $final = VisitorIP(); $passa = $sec['password']; $passc = MD5($passa); mysql_query("INSERT INTO `users`(email,login,IP,pass,passdecoded,ref,signup,activate) values('{$sec['email']}','{$sec['user']}','$final','$passc','$passa','{$ref}',NOW(),'{$activare}')")or die(mysql_error()); $mesaj = "<div class=\"success\">Registered! You need to confirm your email address now!</div>"; }} ?> <div class="block medium right"> <div class="top"> <h1>Register</h1> </div> <div class="content"><div class="msg"><?echo $mesaj;?></div> <form action="" method="post"> <fieldset> <p> <label>Username</label><br/> <input class="text big" type="text" value="" name="user"/> </p> <p> <label>Email</label><br/> <input class="text big" type="email" value="" name="email"/> </p> <p> <label>Password</label> <br/> <input class="password" type="password" value="" name="password"/> </p> <p> <label>Repeat Password</label> <br/> <input class="password" type="password" value="" name="password2"/> </p> <p> <input type="submit" class="button gray small" value="Register" name="register" /> </p> </fieldset> </form> </div> </div> <?include('footer.php');?> Hi All, Its been a while since i've posted, its good to be back. I am currently trying to pull two exchange rates against the $ using YQL's restful url. Unfortunately I am having a huge problem returning the results correct.... currently my array will only output a single rate (instead of two) and the hash array returns with the base rate name rather than the expected currency code. I hope someone can help me sort this as it's given me quite a headache! Please see the code below: Code: [Select] <?php require_once('uwe_proxy.php'); /* * To change this template, choose Tools | Templates * and open the template in the editor. */ # use the yahoo YQL rest service to return any number of rates in a hash function get_yahoo_rest_rate ($base, $curr_arr) { $params = ''; $rates = array(); # define the YQL rest url head & tail $yql_base_uri = "http://query.yahooapis.com/v1/public/yql"; $yql_tail_uri = '&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys'; # build up the $params value foreach($curr_arr as $curr) { $params .= $curr.$base.','; } #strip last comma $params = substr($params, 0, -1); # build the query with the params as comma sep. string eg. USDGBP,USDBOB,.. $yql_query = "select * from yahoo.finance.xchange where pair IN ('{$params}')"; # build the the complete YQL query $yql_query_url = $yql_base_uri . "?q=" . urlencode($yql_query) . $yql_tail_uri; # send the query via proxy and get as string and load as simplexml object $yql_response = @simplexml_load_string(file_get_contents_proxy($yql_query_url)); Print_r($yql_query_url); //- debugging only # process simplexml object and return a sorted hash of rates or FALSE on error if ($yql_response) { foreach($yql_response->results->rate as $rate) { if ((float)$rate->Rate>0) { $rates[substr((string)$rate->attributes()->id, -3)] = (float)$rate->Rate; } } ksort($rates); return $rates; } else { return FALSE; }// print_r($yql_response); - debugging only } /////// - debugging only $curr_arr = array('GBP','GBP'); $rates = get_yahoo_rest_rate ('USD', $curr_arr); //PRINT_R($yql_response); print_r($rates); ?> Sorry about dumping the whole lot - but I really don't know where this is going wrong! Thanks in Advance for any help or pointers in the right direction! Hi, am trying without much luck, (I am new), to define an exchange rate on the page and then mutiplying it by a value I am extracting from a mysql db. I write the value as below normally but having trouble writing this entry and multiplying it by my defined exchanged rate of say 2.22. <?php if(!empty($row['Band_1_Price'])) {echo "<div class=pricing_box_right2>£".$row['Band_1_Price']."</div></div>"; } ?> Thanks so much. imap_fetchstructure is not returing information about attachments for certain e-mails after the mailbox is migrated to exchange 2010. Using IMAP protocol and was working fine until the migration from exchange 2007 to 2010. 99% of emails with attachments works fine, but few don't. I can replicate the issue when an attachment is sent from gmail accounts or some xerox devices to exchange 2010. The output of imap_fetchstructure (message has no body, only attachment) looks like below, as you can see, parts is returning null. I have tested it using imap-2006e and imap-4.7b libraries and produces same issues. Any ideas how to resolve the issue or debug this issue? Can also replicate the problem in Thunderbird 2.0.0.24 stdClass Object ( [type] => 1 [encoding] => 5 [ifsubtype] => 1 [subtype] => MIXED [ifdescription] => 0 [ifid] => 0 [ifdisposition] => 0 [ifdparameters] => 0 [ifparameters] => 1 [parameters] => Array ( => stdClass Object ( [attribute] => boundary [value] => AHNKAKBLDCDIDAGCDHGDAAAKACAK ) ) [parts] => Array ( ) ) Hi I am trying to create a site that determines the device's screen size. Most mobile phone browsers does not have javascript, so to determine the width and height of the screen I cannot use Javascript. Does anyone know how i can test whether a mobile phone is used to visit the site and what that phone's screen resolution is, so that I can redirect it to the right folder. Thanks in advance I'm trying to create a mac widget that will display my college's football schedule. How do i get started pulling the table data of this page? or any webpage for that matter? It doesn't appear to wrapped in any kind of xml Code: [Select] http://www.aggieathletics.com/sports/m-footbl/sched/tam-m-footbl-sched.html The html is about 3/4 of the down in the source code. Hi, i webmaster multi sites and at the moment run php code to block unwanted ip addresses because of bad submittings.
I am running this code at the moment
<?php Hi guys and gals, i have two sites which interact with each other, if someone lands on my local site and searches, if the answer isnt found it will transfer them to my other site which has a wider range for what they are looking for. My question is, how would i go about delaying the transfer and displaying a message that the user is now being transfered to a different site? I was thinking something similar to one of those uploading please wait type overlays or somthing? Any ideas would be useful, at the moment its done with a simple form and php, but is instant. I use this on my sites and it works fine on one and not the others and I can't figure out why. The sites are all hosted at the some place and even share an IP but for some reason only one of them is working. Here's the stamp: Copyright © <?php echo date(Y); ?>. So can someone tell me what the problem is? Thanks I know this has been asked before and I have searched but I can't find an answer. I have a cookie that is set on a customers web site(yes I've tested it and it is defined) and I was going to use it to display certain info on my web site. Sooo ... How do I get a cookie to work across multiple (2) web sites? Thanks |