php

How to get opened ports of a remote server in PHP?

Or is it possible? ...

Naming a text file as a variable

Hey guys, i have a variable $Date that is automatically updated each day. I would like to create a new text file each time that there is a new entry. So basically every day. I would like to use fopen to create a new text file every time a user submits a value, but only for that day. If a user creates another account the next day, it wi...

please tell what this php code is doing. (.net reference)

please tell me what is below code doing? is it creating array with two values or its creating to string index which will take value later? var $requiredValues=Array( 'MaxResponses', 'AvailableOnlyIndicator' ); ...

Is it a god awful idea to generate lots of nested arrays in PHP?

I want to transform the 'values' array created by xml_parse_into_struct() into a bunch of nested arrays which I can walk recursively. This is for a very simple XML class which will hierarchically search the document like so: $xml_data = " <sometag> <someothertag> <somedata>foo</somedata> </someothertag> <someothertag...

Safety when installing plugins on domains I don't own

I developed a wordpress plugin entirely on localhost and tested it on a live server (CPanel) that I have full access to. What I'd like to know is what information I would need from a website owner if I were to install the plugin on their website? The assumption is that the website owner wants to give me as little information as possible,...

Best practices when using XML for PHP configuration?

I was planning to use an XML document to store configuration for my next PHP project, in a format similar to ASP.NET Web.Config files. Just two concerns: Cannot be served to the browser. Must be viable in shared hosting. The best way I could think to prevent it from being served is to change the filetype to PHP and add the following ...

Using call_user_func() with objects

The following two statements should be identical, yet the commented out statement does not work. Can anyone explain ? $peer = GeneralToolkit::getPeerModel($model); //return call_user_func(get_class($peer).'::retrieveByPK',array($comment->getItemId())); return $peer->retrieveByPK($comment->getItemId()); PS: I am using PHP 5.2.11 ...

how to limiting downloading file system via browser only through my web application

I need the best way to prevent any access to doc files when it is not my web application, for example, I need some files to be hidden from search engines or public users and only private users may reach and download them. I would like to save the files in the file system and not in the DB in order not to increase the DB usage. ...

php code for excluding @ # $%^&*

How can I exclude @ # $%^&* from a given string? ...

payment process without leaving the site with paypal and php

Hi All, i want to use paypal as my payment gateway with php. I want that my site user should not be redirected to paypal website for the payment process. Is there any way t do this. And also i want to make payment with credit card only. Thanks in advance Avinash ...

javascript confirm dialog not working properly

Hi, i've been trying to get a confirm box to work, i am using php and jquery to make a confirm box appear when clicking on a delete link, actual code : $(document).ready(function(){ if (jQuery("a.delete-link").length > 0) { $("a.delete-link").bind("click", function(){ return confirm("Sunteti sigur ca doriti sa st...

Dynamic update Ul Li using javascript ( mootools 1.2 ).

Hi all, I have one form which is submitting by ajax. I am running on php. After the entry completed by ajax, that entry should be updated to my html. For example My HTML Code <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> Now when any one insert new entry with 5, then my html should be updated with below HT...

Good JQuery and PHP rating tutorials?

Is there any good JQuery and PHP rating/voting tutorials that are out there that can't be found doing a simple google search? Can you pleas list them if possible thanks. ...

php text box enter event

hello all, i was created one text box and autosuggestion in json used php. enter text box input "a" and autosuggestion output "a" related keywords, i was select any one keyword using keyboard "Down arrow or Up arrow" and "Enter" key pressed. the form action GET method post only "a" letter, not selected words. i want selected words post i...

Key problem: Which key strategy should I use in my database?

Problem: When I use an auto-incrementing primary key in my database, this happens all the time: I want to store an Order with 10 Items. The ordered Items belong to the Order. So I store the order, ask the database for the last inserted id (which is dangerous when it comes to concurrency, right?), and then store the 10 Items with the for...

Strategy to auto-generate PHP code?

I'm developing a framework which programs parts of itself dynamically after creating ER-Diagrams in the backend. As a PHP newbie I wonder if there's anything much fancier than just opening a plain xyz.php text file and then adding the dynamically generated code to that file? ...

Return array of numbers from my db, use them as a test in another query

I'm struggling with some SQL/php syntax issues here. I'm trying to write two functions. The first will query a database and return an array of numbers that match specific criteria. The second will query a database and use the values from the first function to help select the data I'm looking for. Here's what I have of the first func...

Errors inside of output buffer.

I'm having some problems with the output buffer. I am buffering my script and printing the result using a callback. The problem is that if a error is thrown at any point, nothing is being shown and I am getting a blank screen. I have tried setting my own custom error handlers but nothing seems to work. I have a feeling this is because th...

Can We Rotate Page?

Hi, I am not sure but there are many unbelievable things getting done each day. So my question is that can we rotate a generated page with 90 degrees like how we do this in pdf using either php or JavaScript? ...

PHP: .htaccess 301 redirect not working

I have a basic CMS in PHP/MySQL where content managers can create pages to the system for public viewing. Each page is then available at an url such as http://www.example.com/pages.php?pid=123 Now, I want to redirect requests to http://www.example.com/pages.php?pid=123 to http://www.example.com/pages.php?pid=456. I've already removed th...