php

javascript -web development

which one is friendly to develop an webpage application, javascript or php.i want to know which will take less memory and provide more security. ...

How to use Visual Studio for WordPress development?

Does anyone use Visual Studio to do WordPress development? If so, how do you do it? ...

Error uploading file from HTML form

Here is a problem. I have an HTML form with several fields in it. One of the fields - 'Upload file'. When I upload a file, everything works properly. But when I choose to submit the form without a file, it gives me the error message: "There was an error uploading the file, please try again". Looks to me that the script thinks that upload...

Insert and delete emails from a text file using PHP

Hi i am creating an under construction page where users can leave their email to be notified when the site launch i need to add those emails to a text file called list.txt my question is two parts how can i add [email protected] to the text file ? and how i can later delete certain email from a text file ? thanks for help ...

The number 0 is not being passed through.

I had a problem with a piece of code i just developed and I have narrowed it down to the number 0 not being accepted. This is the html <input type="text" size="1" name="hs" maxlength='3'> If I enter ZERO into that input box it gives an error saying nothing has been entered. Once I have passed this through, this is the PHP error hand...

Need PHP to sort files ALPHA and NUMERIC

I have a bit of PHP code that grabs a list of files from a directory, and puts them into an array. I can sort the array alphabetically, and the file list comes out like this: (Ex A) CC 2010.pdf CCP 2010.PDF RS 1 2010.PDF RS 15 2010.PDF RS 2 2010.PDF I want PHP to sort alphabetically but also take into consideration sorting files wit...

Sorting Prices from XML

Hey Everyone, I am trying to sort the results by prices of an xml with info related to hotels. I want to display and sort the data by prices, given by a value called minCostStay, so ASC and DESC are must to do this. I am using foreach to display the data endlessly. What I need to do now is sort out these data by price asc and desc. I a...

Getting the value of dynamically created text box in PHP

I have a link. Whenever it is clicked, a new page will be displayed which contains data such as id, name, price and a select option with a check box. This page also contains a button. All these details (id, name, price) are fetched from a table. If the check box is checked and the button is clicked, a new page with the selected values al...

Making sessions / cookies indefinite

Hello, I am using a login system that sets the session variables / cookies below. Chrome, which awesomely lets you look at your cookies without too much trouble, apparently labels this as a PHPSESSID that expire "When I close my broswer." Sure enough, when I log in, shut down the browser, and then open up a new browser session, I am n...

How to write special characters into MySQL via PHP?

In my database in some fields the data is showing like as in following screenshots: http://i31.tinypic.com/2637l9f.jpg http://i27.tinypic.com/1ihh6d.jpg http://i26.tinypic.com/2yklzb4.jpg http://i31.tinypic.com/2vbshtf.jpg I used mysql_real_escape_string while inserting my data into database and htmlspecialchars while displaying. ...

Grab it if it's there, forget it if it's not Regular Expression

I'm parsing a file with address details. Sometimes the address has one fax number, sometimes it has two fax numbers (on separate lines). How can I say "If there's a second fax number, grab it. If not, forget it" to my regex engine? Here's an example with one fax number: Tel: +1 212 12345 Fax: +1 212 23456 District HQ: Sprin...

jQuery ajax is not working on Mozilla only

I have following script $.ajax({ type:"GET", url:"views/jquery/js/private/visual_constructor/proxy.php", data:null, timeout:55000, dataType:"xml", error:function(XMLHttpRequest, textStatus, errorThrown){ alert("error="+XMLHttpRequest+" error2="+textStatus+" error3="+errorThrown); }, success:function(res...

Is there any good solution to update page content with ajax using codeigniter?

Im currently using codeigniter to build a messaging system and im trying to stay within the MVC guidelines, however I can't seem to find a way to easily update dynamic page content without having the HTML dynamically generated in the controller; which I believe is frowned upon when using an MVC framework. Currently I am using ajax to r...

PHP Create File on Network Share

I can read files using PHP from a network share, but how can I create a file and folder on a network share? ...

cURL doesn't seem to work in a while loop

I'll just post the whole thing since it would be a bit confusing otherwise: <?php echo "<html> <head> <title>ARMORY.</title> <meta http-equiv='Content-Type' content='text/html' charset=iso-8859-1> </head> <body> <table width='50%' border='1' cellpadding='10' cellspacing='10'>"; $server = "Sunstrider"; $guild = "Mist"; $url='ht...

Multiple login forms submitting to one login action

I'm having 2 login forms in my (cake) application. One on the home page (served by pages controller) and one in my user controller. The one from my user controller is working fine. But when I try to login from the homepage I get a blank page and I see in firebug I got a 404. The strange thing is that the session is setup OK. It's looks...

How to execute two MySQL queries ?

I want to save the file path of a picture, AND the image name, in the same table, but separate fields of course. How can I execute it properly? I'm sure there is something significantly wrong in the code below, but I can't spot it. Thank you. $sess_userid = mysql_real_escape_string($_SESSION['userid']); $Image = mysql_real_escape_string...

Algorithm to get the excel-like column name of a number

I'm working on a script that generate some Excel documents and I need to convert a number into its column name equivalent. For example: 1 => A 2 => B 27 => AA 28 => AB 14558 => UMX I have already written an algorithm to do so, but I'd like to know whether are simpler or faster ways to do it: function numberToColumnName($number){ ...

php spambot prevention on signup

I dont have any problems with spam bots (yet). Do you really have to use captcha? I hate it myself, some can be hard to read What about just one field with a simple question any human could answer? like "what animal is Donald Duck?" then in php i check if its = duck. maybe load some diffrent questions from db How can spambots figur...

How to add reviews and rating to each record (clinic) on webpage, that is store in the database?

Hi everyone! I want to add reviews and rating to each (clinic) record of the database. If people search a clinic, the webpage shows multiple (clinics) records on the webpage, and then user can rate and write review to any clinic or multiple clinics. Then each clinic will show there won rating stars. Like in this link http://search.y...