php

Download file attached to header with Curl and Php

Hi I'm connecting to a website daily to collect some statistics, the website runs .net to make things extra difficult. What i would like to do is to mechanize this process. I go to http://www.thesite.com:8080/statistics/Login.aspx?ReturnUrl=%2Fstatistics%2Fdataexport.ashx%3FReport%3D99, (the return url is /statistics/dataexport.ashx?Re...

Check mysql_query results if DELETE query worked?

I have a DELETE query which deletes a record from a mysql db. is there any way to make sure if the delete was performed or not? I mean, for a query to FIND stuff you do $res=mysql_query($var); $nr=mysql_num_rows($res); and you get nr of rows returned. Is there any similiar method for deletion of records? Thanks ...

Reading large excel file with PHP

I'm trying to read a 17MB excel file (2003) with PHPExcel1.7.3c, but it crushes already while loading the file, after exceeding the 120 seconds limit I have. Is there another library that can do it more efficiently? I have no need in styling, I only need it to support UTF8. Thanks for your help ...

VB - Server communication

How would I make a Visual Basic application talk to a web server? Someone will press something on the site and I want the application to display the information that the web site passes along to it. ...

ASP.NET/PHP/HTML: Retrieving HTML source code from a website

Hi, Is it possible to retrieve/get the html source code of a certain website and use it in a ASP.NET web application to display them? (without using the copy-paste, of course) I want my ASP.NET web application to use them as part of a code sample feature I currently working on. I'm also considering working it on PHP. Any suggestions? ...

PHP mysqli error return time

Hello. Can i ask a fundamental question. Why when I try to create a new mysqli object in php with invalid database infomation (say an incorrect database name) does it not return an error intstantly? I usually program server stuff in Java and something like this would throw back an error strait away, not after 20 seconds or so. For ex...

How to open form action in Jquery Dialog

I have a form: <form style="display: inline;" action="/player.php" method="post"> <input type="hidden" name="recname" value="'.$row['name'].'"> <input type="hidden" name="recordingdesc" value="'.$row['description'].'"> <input type="hidden" name="reclink" value="$_SESSION['customerid'].'-'.$row['timest...

PHP5: restrict access to function to certain classes

Is there a way in PHP5 to only allow a certain class or set of classes to call a particular function? For example, let's say I have three classes ("Foo", "Bar", and "Baz"), all with similarly-named methods, and I want Bar to be able to call Foo::foo() but deny Baz the ability to make that call: class Foo { static function foo() { pr...

Intersection of two regular expressions

Hi, Im looking for function (PHP will be the best), which returns true whether exists string matches both regexpA and regexpB. Example 1: $regexpA = '[0-9]+'; $regexpB = '[0-9]{2,3}'; hasRegularsIntersection($regexpA,$regexpB) returns TRUE because '12' matches both regexps Example 2: $regexpA = '[0-9]+'; $regexpB = '[a-z]+'; has...

Getting content of the node having childs via DOMDocument

I have following html: <html ><body >Body text <div >div content</div></body></html> How could I get content of body without nested <div>? I need to get 'Body text', but do not have a clue how to do this. result of running $domhtml = DOMDocument::loadHTML($html); print $domhtml->getElementsByTagName('body')->item(0)->nodeValue; ...

Best way to add/change 1 GET value while keeping others?

How can I make a link that justs adds or changes 1 GET var while maintaining all others? I have a page that is created using different GET vars. So it will be like mypage.php?color=red&size=7&brand=some%20brand So I want to have a link that sets it to page=2 or size=8. Whats the easiest way to have a link do that without reseting all ...

Doctrine findOneBy invalid field name where field does exist

I'm using Zend Framework with Doctrine. I'm creating an object, editing, then saving it. That works fine. However, when I later try to find that object based on one of the column values, Doctrine throws an error saying, "Message: Invalid field name to find by:". Notice there is no field name listed in the error message after the :. My ...

PHP function to know upload_max_filesize

I'v searching for a while in php.net and I don't find what I'm searching. I need a function to know the max_upload_filesize from a PHP function. Here what I need: http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize Thanks in advance! ...

I can't delete records from MySql

I have two tables. table a references table b I believe. When I try to delete the package alltogether like this: $query="DELETE a, b FROM classified as a, $sql_table as b WHERE a.ad_id = '$id' AND a.classified_id = b.classified_id AND a.poster_password='$pass'"; b MUST be deleted first I guess. Even in PhpMyAdmin I cant delete a if ...

Problem in Union Join For MySQL Query

hey guys i managed to select from a table that saves my latest posts but i need to have double condition in selection here is my code : $sql_query = "SELECT b.*,u.username AS MY_Sender FROM TABLE_users u,TABLE_blogs b Where b.reciever = '0' AND u.user_id = b.sender UNION SELECT b.*,u.username AS MY_reciever FROM TABLE_users u,TABL...

Javascript form validation events

Hi All, I am making a small form for a php app and had a question regarding javascript validation. What is the best event to run the javascript validation on the input value? Is it the "focusout" event? I used "focusout" to originally but it creates problems when the user hits enter while they are still focused on any particular fiel...

PHP: need more decimal places for sinus calculation

Hi volks, to calculate some longitude and latitude values I need more decimal places like mysql is possible to do. For instance with mysql I get this result: cos( RADIANS( 47.685618 ) ) = 0.67319814951254 With PHP 5.2 I only get: cos( deg2rad( 47.685618 ) ) = 0.673198149513 Two decimal places shorter but I need them. I know I a...

locking save button for some time

hi, i am using php,mysql,jquery. When a user clicks on save i go to back end and save data and show the response. once show the success i need to disable the save button for say 1 min. how do i do it.? here is ma code $(document).ready(function() { if ($.cookie('<?php echo $userId ?><?php echo $product ?><?php echo $alias ?>a...

In CodeIgniter, how to clear "form data" after redirecting page

I'm not sure I explained it correctly in the question title, so here's the details: Login controller: function authenticate() { if ( authorized ) { redirect('lobby'); } else { redirect('login'); } } Lobby controller: function index() { //load lobby view } What happens is that in the login page, I en...

need to run php script when form is submitted

I have a form that needs to run a php script once the submit button is clicked, it needs to be ajax. <form method="post" action="index.php" id="entryform" name="entryform"> <input type="submit" name="submit" value="Submit" onclick="JavaScript:xmlhttpPost('/web/ee_web/include/email-notification.php', 'entryform')" /> </form> In this si...