php

Form Validation using Javascript inside PHP

I have a simple problem but no matter what I try I can't see to get it to work. I have a form on a php page and I need to validate the qty value on my form so that it doesn't exceed $qty (value pulled from mySQL) and is not less than zero. Sounds easy--hmm wish it were..lol! I had it checking if the value was numeric and in my attempts t...

Correct syntax for php inside a feed request

Hi guys, I have a very basic query string which passes a ID to a receiving page. On that page, I need to dynamically call the YouTube API, giving my playlistID. I'm having to use PHP for this, and it's a little out of my comfort zone, so hopefully someone can wade in with a quick fix for me. Here is my variable $playlist; And I ne...

Can PHP array passed POST method to catch in ASP.NET MVC?

Can PHP array passed POST method to catch in ASP.NET MVC? Query string: WebAccess/ArrayTest?val[]=1&val[]=2&val[]=3 I write: ActionResult ArrayTest (String[] val) But this only works if the query string to remove the "[]" ...

How to display only necessary information from xml

I have xml table: <?xml version="1.0" encoding="UTF-8"?> <table> <user> <id>1</id> <info> <more> <nick>John</nick> <adress>blabla</adress> </more> <more> <nick>Mike</nick> <adress>blablabla</adress> <tel>blablabla</tel> </more> </info> </user> <user> <id>2</id> <info> ...

Creating a personal URL for all users to my site

Hello all, When a user registers with my site I want to offer them a login page and a user area with the URL: http://user1.mysite.com http://user2.mysite.com http://user3.mysite.com ... I did a google search for this but I wasn't sure of the right terms... How can I do this without having to actually create lots of subdomains...

SQL Select * from multiple tables

Using PHP/PDO/MySQL is it possible to use a wildcard for the columns when a select is done on multiple tables and the returned array keys are fully qualified to avoid column name clash? example: SELECT * from table1, table2; gives: Array keys are 'table1.id', 'table2.id', 'table1.name' etc. I tried "SELECT table1.*,table2.* ..." but...

NetBeans PHP run configuration: how can I omit the doc-root folder?

So I have this project in PHP where I have some include files next to the wwwroot (or doc-root) folder instead of under the wwwroot folder. I need however to run/debug this project. in the project properties I can select a index file (index.php) but it's under the doc-root folder, so the Project URL makes http://myprojectmachine/doc-root...

Why would $this->data show up an empty array after submit?

In Cakephp Why would $this->data show up an empty array after submit? i am using the security component. ...

Custom header using PHP soap functions

Hi, I am having a problem getting a custom soap header to work with PHP5. Can anybody guide me please. What I require is something like this <SOAP-ENV:Header> <USER>myusername</USER> <PASSWORD>mypassword</PASSWORD> </SOAP-ENV:Header> What I get is : <SOAP-ENV:Header> <ns2:null> <USER>myusername</USER> <PASSWORD>myp...

PHP - Read number of dirs and then require for each a specified file name

Hello, I want to make a little script but I'm rather n00b in php so please help me if you can :) What I want the script to do is: I have "index.php". I want "index.php" to read the sub-directories from a known folder, let's say "templates/" Each sub-directory will contain a file called "content.html". The index will then load the "co...

How do I code a loop for my echo statement?

I get only one printed result in the foreach echo loop at the bottom of the page. <?php defined('_JEXEC') or die('Restricted access'); $db =& JFactory::getDBO(); $query0 = "SELECT * FROM `jos_ginfo` WHERE . . . LIMIT 30"; //echo $query0; $db->setQuery($query0); $ginfo = $db->loadObjectList(); //echo /...

Finding if the current page is in a Zend Navigation object

I have more than one Zend_Navigation object in my application. I want to do a test to find out which object holds the page I'm currently on. I didn't see methods for doing that in the documentation. Can this be accomplished? How? Thanks! ...

PHP Get all subdirectories of a given directory

How can I Get all subdirectories of a given directory (without files and "." or "..") and then use each directory in a function? Thanks. ...

Losing reference to $_post variable?

In the code below, the echo at the top returns true, but the echo at the bottom returns nothing. Apparently the code in between is causing me to lose a reference to the $_post variable? <?php echo "in category: ".in_category('is-sidebar'); //RETURNS TRUE if (!get_option('my_hide_recent')) { $cat=get_cat_ID('top-menu'); $catHidd...

How can I decrypt password string in PHP which was encrypted with crypt?

How can I decrypt a password string in PHP which was encrypted with crypt? $salt = substr($_POST['password'], 0, 2); $password = crypt($_POST['password'], $salt); I need to send the original password in a forget password e-mail. ...

how do you write a function like print_r() that recursively prints objects?

i want to write a function that prints multi-dimensional objects which are text (or integers, etc.) into <span></span> tags and arrays into unordered lists. how do you make the function work recursively so that it prints everything regardless of what level it's at in the object? thanks! ...

Ordering content from the YouTube API with PHP & XML

I've got a nice little web app working that brings down playlists and videos from YouTube using the API. However, YouTube seems to fire back the playlists in the wrong order. Any idea how I can do that? Here is my very simple PHP code that does everything I need it to do (apart from date ordering) <?php // set feed URL $feedURL = ...

Flex - Increase timeout on a PHP service function call

I'm using Flash Builder 4 Beta 2. I have it connecting to a PHP service. The way I set this up was using the wizard, so I didn't actually write the code to connect to it. The service looks like this: package services.flash { import mx.rpc.AsyncToken; import com.adobe.fiber.core.model_internal; import mx.rpc.AbstractOperation; import val...

[PHP] Multi-upload

Hello there, I am trying to upload 2 files, the first one is a flash (.swf) file and the second a .png. At the moment, I would have no problem making 2 different php upload file, with 2 different forms, but Im sure there can be a way to make that all together. I am not really experimented with PHP, but Im trying to learn. At the mome...

Php/MySQL to ASP.NET/SQL Server, Suggest if its worth the trouble.

We have been using PHP/MySQL for our web application which has been growing a lot, the database is around 4-5GB and one of the table is 2GB sometimes, hence slowing down whenever any queries to that table is called. Should we just try to optimize, or are we using MySQL above its limit? Will switching our web app to .NET/SQL Server reso...