php

Getting duplicate array entries after parsing with regex

I am using regex in my PHP script to check a page for Rapidshare links, and load them into an array. My code: if(preg_match_all('/http:\/\/rapidshare\.com\/files\/.*?\/[^\s]+/', $links[0], $links)) { print_r($links); } else { die('Cannot find post links :('); } It finds the links correctly, and puts them into an array: Array...

why are form variables not available in this php code?

I have a form on my PHP page which performs some ajax validation (that's working). Here's a snippet (the live form has more fields than this) <form name="form" onSubmit="return validate_form();" action="submitform.php" method="post"> <table border="0" cellpadding="5" bgcolor="#000000"> <tr> <td width="175...

CodeIgniter - Parser Class and DB Issue

Oddest bug. I'm parsing a template and inserting same values pulled from a db. I also have a model set up that logs some statistics each time the parsed page is viewed(all brought together in the same method). Trouble I'm having is that the stat is logged three times in the db. Identical values on three different rows. I am using some ...

New to Encryption with PHP, Direction Please?

I'm working on a very small form that accepts credit card numbers, which will be cleaned out shortly thereafter. For the time they exist in the database, I'd like them to exist in a comfortable state of encryption. Unfortunately, in my many years of web-development, programming, and database-development, I've not once had the opportunity...

API integration with Rails or Other Language

Hi All, I need the API integration for the following site 1] alamo car service 2] avis car service 3] thrifty car service 4] hertz car service If any one know anything regarding any of the above please reply. Regards, Salil ...

Import large file on MySQL DB

Hello; I want to insert about 50,000 mysql query for 'insert' in mysql db, for this i have 2 options, 1- Directly import the (.sql) file: Following error is occur " You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit. " 2- Use php code to insert these queries in form of differ...

php and htaccess

In the .htaccess file can we change the file extention to be display. Like my .htacces file rewrite any .html files to .php fileS WITH THE BELOW CODE. RewriteEngine On RewriteRule (.*).html$ $1.php [L] If the URL typed as http://localhost/test/test.html it will internally called test.php file. However I would like the page to have th...

Help with mysqli and multiple queries

I've never had to use mysqli until today and cannot seem to get this right. What I want is a simple function that will accept a mysql procedure call and have it return those results. When I started using these procedures, I noticed that the old way of querying the database, using mysql_query, would no longer get me the expected results;...

Should I use an XMLHttpRequest /JSON or an iFrame?

I have been making extensive use of XMLHttpRequests and JSON to fetch from a MySQL database and return records as arrays. It works perfectly. Additionally, I have three cases in which I have the server (via PHP) formatting the data as a web page and creating bar charts (as opposed to sending arrays back to JavaScript for processing). Cu...

JQuery displaying PHP functions.

I've been trying to do add a couple of new features to my script all day for example, I want to be able to display the average rate and votes casted under my star rating images, like some thing in the example below. ********** 9.8/10 (1160 vote cast) I've been trying everything and run into new problem after problem after problem. For...

Java with Drupal-6/PHP

I really dislike PHP, but am pretty comfortable in Java. I have a stable Drupal installation that has been deployed to an Apache/Linux server. I don't know if the server currently supports Java. (What does it take to do that? I have programming in desktop apps for Java but never online before.) For developing new modules for my site, is...

Doctrine Subquery in InnerJoin

i have functional query in MySql: select t.won,e.etot, s.username,s.country,r.points,r.rank FROM sf_guard_user s INNER JOIN marks r ON r.user_id = s.id inner join (select t.user_id,count(t.user_id)as won from topper t group by t.user_id) t on t.user_id=s.id inner join (select e.user_id,count(e.user_id)as etot from exams e group by e.u...

Format XML Document created with PHP - DomDocument

I am trying to format visually how my XML file looks when it is output. Right now if you go here and view the source you will see what the file looks like. The PHP I have that creates the file is: (Note, $links_array is an array of urls) header('Content-Type: text/xml'); $sitemap = new DOMDocument; // create r...

How do I save an html page to a database?

I just want to know if it's possible. How do I save an html page and all of its contents to a database? like for example, I have a database wherein it consists all HTML pages. Just want to know if its possible. And how to retrieve it too. We're using PHP as our language. Thank you. ...

Magento installation on local host

Hi i want to do a project in my local host. But i don't know how to install on my PHP Apache local server. Does any one help me? ...

PHP Sessions Issue

Hey Guys, I am having one hell of a problem that I cannot figure out for the life of me. I have set up a super simple CMS for a client. Each different page of the CMS has and include file called session.php. session_start(); $username = $_SESSION['siteadmin']; if (!$_SESSION['siteadmin']){ header( 'Location: login.php?status=2' );...

How to santize user inputs in PHP?

Is this enough? $listing = mysql_real_escape_string(htmlspecialchars($_POST['listing'])); ...

PHP - For loop only returns last variable in array

I have a strange problem where a for loop in PHP only returns the last item in my array. The array is created with SimpleXML from an XML file. The code should return this: <tags><tag value="Tag1" /><tag value="Tag2" /><tag value="Tag3" /></tags> But instead I just get: <tags><tag value="Tag3" /></tags> So it ignores all but the l...

Algorithm to parse a config file in php (Doxygen file)

hi, I have a conf file like this: http://pastie.org/768582 and my goal is to get in an array the comments and the key/value of each keys. array( array( 'comment' => "The PROJECT_NAME tag is a single", 'key' => "PROJECT_NAME", 'value' => "JMK", ), ) I would know what algoritm do I have to use? I have already tra...

is there some PHP social crm, plugins, or frameworks?

Hello, What i need to do: I'm trying to realize social networking graph for companies, employees in CRM. They could have many complex relationships. A company can have its network like inverstors, partners, competitors and customers etc. I want to realize a dynamic social networking graph for it. And it has to be implemented by php. ...