php

Proxy between BasicHttpBinding and WsHttpBinding

Hi all, For an important customer, I've to implement a SoapClient in PHP to connect to a .Net webservice setup in WsHttpBinding. I know PHP SoapClient doesn't support it. So my goal is to develop a proxy software written in C# which will be a 'bridge' between BasicHttpBinding and WsHttpBinding. So PHP will communicate only with BasicHt...

need help with Preg_replace Regular expressions

these word1 and word2 is in brackets want to remove the whole line depends on word2 [word1] something-line-text [word2] some text again want to replace some text with another depends on word2 [word1] something-line-text [word2] some text again into REPLCACEDTEXT something-line-text some text again some line text (something/...

image crop showing black bg

i have this image crop code that when the image does get cropped a black background is added in the picture. how can i remove it? thanks $fldcategory = $_POST['category']; $flname = $_FILES['upload']['name']; $img_src = $_FILES['upload']['tmp_name']; $thumb = "uploads/" . $flname; $title = $_POST['title']; // Open image $i...

how can I recieve this form in cart.php

$index = 1; foreach($product['varieties'] as $variety){ echo '<input style="width:10px; margin-left:9px; " name="price_' . $index . '" type="checkbox" value="' . $variety['price']. '" />'; echo '<input name="size_' . $index . '" type="text" value="' . $variety['size']. '" />'; $index++; } if you can see This will have an...

Get source code with Chinese characters PHP

Well, I give up. I've been messing around with all I could think of to retrieve data from a target website that has information in traditional Chinese encoding (charset=GB2312). I've been using the simple_html_parser like always but it doesn't seem to return the Chinese characters, in fact all I get are some weird question marks embedde...

unexpected mysql error saying must be an instance of mysqli_result?

Ugh, got this unexpected error: Argument 1 passed to QMySqliDatabaseResult::__construct() must be an instance of mysqli_result, boolean given, called in /home/aptana/domains/staging-allyforce.aptanacloud.com/web/htdocs/includes/qcodo/_core/database/QMySqli5Database.class.php on line 52 and defined Error Type: Unknown I'm not sure w...

syntax error T_PAAMAYIM_NEKUDOTAYIM!

buy.php: <form action="cart.php" method="post"> <?php foreach($product['varieties'] as $variety): ?> <input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="<?php echo $variety['price'] . '_' . $variety['size']; ?>" />'; <?php end foreach; ?> </form> cart.php: list($aDoor, size) = split('_', $_POST['p...

Including JavaScript validation in a form submit in PHP

Is it possible to to submit an HTML Form (with a PHP action) and include a javascript onsubmit="VerifyFields()? I am trying to do it now, but it seems that it will do the PHP action and not do the onsubmit. Update: Thanks for all of your help. The problem was that I was putting my VerifyMe() function in the <head></head>, as opposed...

each() and list() function

I don't understand the each() and the list() function that well. Can anyone please give me a little more detail and explain to me how can it be useful? Edit: <?php $foo = array("bob", "fred", "jussi", "jouni", "egon", "marliese"); $bar = each($foo); print_r($bar); ?> Array ( [1] => bob [value] => bob [0] => 0 [key] => ...

RackSpace Cloud Strips $_SESSION if URL Has Certain File Extensions

The Situation I am creating a video training site for a client on the RackSpace Cloud using the traditional LAMP stack (RackSpace's cloud has both Windows and LAMP stacks). The videos and other media files I'm serving on this site need to be protected as my client charges money for access to them. There is no DRM or funny business like ...

MongoDB and CodeIgniter

Can anyone assist in pointing me to a tutorial, library, etc. that will allow me to work with MongoDB from CodeIgniter? Any help is really appreciated. ...

PHP vertify against multiple criteria (more like I don't think this very long if statement is good.. code effiecentcy help!!)

So in PHP, I am checking a file extension against multiple types to get the general type of file so here is what I have for images alone: if ( $ext == "bmp" || $ext == "jpg" || $ext == "png" || $ext == "psd" || $ext =="psp" || $ext == "thm" || $ext == "tif" || $ext == "ai" || $ext == "drw" || $ext == "eps" || $ext == "ps" || $ext == "s...

How to deal with strange rounding of floats in PHP

As we all know, floating point arithmetic is not always completely accurate, but how do you deal with its inconsistencies? As an example, in PHP 5.2.9: (this doesn't happen in 5.3) echo round(14.99225, 4); // 14.9923 echo round(15.99225, 4); // 15.9923 echo round(16.99225, 4); // 16.9922 ?? echo round(17.99225, 4); // 17.9922 ?? ...

Need help receiving and listing the values of an array variable after receiving it from a form.

i have this in buy.php <form action="cart.php"> <?php echo'<input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="' . $variety['price']. '" /> <input name="variety[]" type="hidden" value="' . $variety['variety']. '" />'; ?> </form> Then to receive in cart.php I do it like <?php $aD...

how rand (timestamp) works if running on webserver?

while studying some security things, there was a question that one can guess the generation of some sequence for rand (timestamp) running in webserver. He said that our first goal should crash the server (assuming that server will get up in 1 min), we can sync our generator with server and then rand (timestamp) generated by the webserver...

Restrict content access to logged in users with PHP

I have a LAMP setup and I just want to be able to protect content on the webpage (images,css,videos,etc) so that only logged in users can access it. I realize I can do this easily with .htaccess. However I do not want to use the authentication popup, and I want to be able to use sessions and also be able to logout. I am using php to do...

Using hash characters in 'pretty urls'

I haven't found a good resource in using # in urls to enable bookmarking with ajax calls so I have a few questions. We have a site based on CakePHP using 'pretty' urls essentially www.mysite.com/controller/action/param1:param2 I noticed that Facebook uses a weird syntax with their pretty urls ex) #!/?ref=logo Is there a way we can use ...

Need help on writing php testing files to test my PHP controller class

Hello all,followed by my previous website development,we have built several controller classs corresponding to entities that will appear in our website development.and our website is very simple:just a shopping website for customers to book bus for travel. Now I am assigned a challenging task that need to be done,that is ,for a single c...

How to use a mysql query to check if a ad should be enhanced

Hello! I have a problem with emphsizing an advertisement - i need to have to different designs for enhanced and non-enhanced ad's! My table is like this: id int(11) UNIQUE // the unique id of the row adresse text // the adress of an advertisement fremhaevninger int(11) // the number of emphasizings of the ad dato datetime ...

weird bit character display

I am storing x and y as bits in mysql database, upon fetch the record using php fetch_assoc, the display is gobbled. And I can't find a way to test the value to see if it's true or false... I tried using if($val), if($val==true) if($val===true), if $val is false, all 3 tests still returns true. any idea? [x] => � [y] => thanks for the...