php

Do you need 2 languages with ASP.NET, but only one for PHP/Ruby?

I'm interested in wed development and web 2.0 but I'm a real beginner, so I'm reading a lot about the technologies involved. I'm beginning to move towards ASP.NET because of the great free resources for learning. However, as I begin to work in "Visual Web Developer Express" I notice that I need to understand ASP and C# or VB. Two techno...

How can I turn all rewrite x.php into x.css in a specific directory?

I need to rewrite all the files in a directory and essentially make their extentions css instead of php. I want to do with with a .htaccess file within that specific directory. What is the correct method of doing so and are there any special PHP headers I need to set the ensure the file is read as a .css file correctly? ...

How to set form validation rules for CodeIgniter dynamically ?

With the new version of CodeIgniter you can only set rules in a static form_validation.php file. I need to analyze the posted info, i.e, only if they select a checkbox, only then do I want certain fields to be validated. What's the best way to do that? Or do I must use the old form validation class (which is deprecated now) ...

Language neutral entry pages

My old web site has an index.html page … nothing strange! Everything is fine. The new web site has an english and a french version, so the new index is index.php?lang=eng…. That makes sense. I don’t like to make a front page that will say “english” or “french”. But that’s not good for ranking or seo. So the question is: How do I manag...

Simple Practical Usable PHP Logic for Recurrence

Befor I ask this question, I have a favor to ask, PLEASE don't down vote this question till it has some real answers.... PLEASE! I have submitted this previously as the following question http://stackoverflow.com/questions/579892/php-calendar-recurrence-logic but because someone down voted it and said it was already answered, noone w...

Using sql JOIN...

I'm a sql noob trying to get this query to use 2 tables. tables & columns are: person: department_id, name, etc... department: department_id, dept_name, etc... I have a 'select' html form that the user will choose a dept_name from, and I need my php script to return every person with a matching department_id. ...

Can anyone recommend a good bar chart component for Showing goal progress?

I'm about to start working on a PHP application that allows a user to track their progress on a day to day basis. I'm looking for a good graphing library, preferably PHP and or Javascript (JQuery would be good) which will allow me to name each bar on a bar graph with a date (10 Feb, 11 Feb, 12 Feb, etc.) probably on it's side or at a 45...

How can I execute a PHP function in a form action?

I am trying to run a function from a PHP script in the form action. My code: <?php require_once ( 'username.php' ); echo ' <form name="form1" method="post" action="username()"> <p> <label> <input type="text" name="textfield" id="textfield"> </label> </p> <p> <label> <input type="submit" name="button" id="...

Pass array into a stored procedure

I am trying to pass an array of values from php to mysql stored procedures as parameter list and how to use the array inside the stored procedure. The query in the procedure has three IN statements in in there so I would like to do IN(@listOfids) where @listOfids is 1,2,3,4 (an imploded array from php). ...

How do you comment html templates in Php (in a practical way) ?

Is there a simple solution to do the equivalent of Java's comments: <%-- this is a comment inside a template, it does not appear in the output HTML --%> Even if you use short php tags, you still have to wrap the comments with comment syntax, on top of the php tags: <? /* this is a comment of the html template */ ?> I'm considering ...

How to build a PHP webmail script?

1) How can a linux server be configured such that it can receive any emails sent to [email protected]. 2) How can these emails be accessed and displayed by a PHP script? I'm building a simple web mail script, so i want to receive emails only for the registered email accounts and classify their emails and show them. Needs also to hav...

Parse XML with Namespace using SimpleXML

I have this as xml: <event:event> <event:sessionKey></event:sessionKey> <event:sessionName>Learn QB in Minutes</event:sessionName> <event:sessionType>9</event:sessionType> <event:hostWebExID></event:hostWebExID> <event:startDate>02/12/2009</event:startDate> <event:endDate>02/12/2009<...

How to Mono, PHP and .NET module run together on Ubunty Hardy at Slicehost?

I'm running a rails app and PHP at my SliceHost Ubuntu Hardy Heron vps server. I've a PdfProcess.exe module built upon ASP.NET (.NET 2). I've one PHP file which uses a passthru("PdfProcess.exe ......") function which loads a pdf template and outputs a new processed pdf file and sent to browser. The combination of PdfProcess.exe and PHP p...

What is the difference between require and include with php?

I want to know when I should use include or require and what's the advantage of each one. Thanks! ...

PHP mysqli unexpected parameter Question

I feel like a total n00b for not understanding what I'm doing wrong, but here goes. I'm writing a simple web form that's storing information in a MySQL database. I'm getting this error: mysqli_stmt_init() expects parameter 1 to be mysqli, null given in /myfile.php Here's my code: $server = 'localhost'; $username = 'myusername'; $pas...

inserting additional values immediately following a successful insert using PHP+MySQL

if(isset($_REQUEST['SAVE'])) { $sql = "SELECT SecName FROM section WHERE SecID='$section'"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)){ $SecName = $row["SecName"]; } $sql = "SELECT SubjName FROM subject WHERE SubjID='$subject'"; $result = mysql_query($sql); while ($row = mys...

Routine for removing ALL junk from incoming strings?

Sometimes when a user is copying and pasting data into an input form we get characters like the following: didn’t,“ for beginning quotes and †for end quote, etc ... I use this routine to sanitize most input on web forms (I wrote it a while ago but am also looking for improvements): function fnSanitizePost($data) //escapes,st...

problem with php mysql query...

I have a form with method = post submitting to a form handler file which is writing the post to a DB and then emailing the result to a user. I have written an insert statement but when the form is being processed I'm getting an error, but not being a DB whiz I'm not really sure what the problem is. Here's the code-- // MYSQL QUERY $re...

Which should I use, pear MDB2 or pear DB_DataObject when I use MySQL when I can not use PDO?

Almost all of free web hosting server, you can not use PDO + MySQL. They lack PDO drivers. So I am considering to select pear MDB2, or DB_DataObject. Which do you reccomend to me? Give me your opinions! ...

Best practices for storing bank information in a database

Summary of answers: Don't do it. The legal and financial implications will be disastrous. Look for established third party solutions or hire an expert. Never store any sensitive information on a shared server. Research for the most appropriate encryption mechanism. I am buiding a website for a customer that needs to store his client...