Essentially I have been trying to think of a PHP-based solution to do the following:
The player needs a link ie:
"http://yourdomain.com/xspf_player.swf?playlist_url=http://yourdomain.com/yourplaylistlist.xspf">
I could easily put the XSPF information in a PHP file and replace the artist name / song name with variables that retrieve th...
Hi there,
I'm trying to use a post form to generate an excel file after choosing which data to grab from a MySQL database. I'm using cURL because I essentially want to double-post: first to save any settings of which fields are being used, and second to generate the Excel file, all with one button.
I have a PHP page set up with the cor...
For the CodeIgniter project I'm creating, it is necessary that users get activated manually by an admin after registering.
Currently I'm using Tank Auth (http://www.konyukhov.com/soft/tank_auth/) for user authentication, and it seems to be missing this particular setting. Is there any chance I just didn't find the setting? If not, how ...
Want to archive a folder using tar from PHP:
$result = shell_exec("tar cf $sourceFile $sourceFolder -C $source > /dev/null; echo $?");
var_dump($result);
Output:
string(2) "2 "
the > /dev/null; echo $? thing is for outputing the result code of a script under linux;
the -C $source - changes to the right folder before doing anythi...
My website is language independent, I have several language packs that I include based on user selection.
User selection form:
<form action='' method='POST'>
<select name='language' onchange='this.form.submit();'>
<optgroup>
<option>Language</option>
<option value='eng'>English</option>
<o...
I cannot find a way to get the user's home directory (e.g. /home/jack; whatever ~ in bash points to) in PHP using CGI (suPHP). The $_ENV array is empty, and getenv('HOME') returns nothing.
The reason I want to do this is that in absense of configuration saying otherwise, I want to find variable files used by my application in /home/user...
I have some HTML, and I'm extracting a snippet at a certain point (an inline image), but I'd like to show some context around this image.
I'm using PHP, and I know that both Symfony and Wordpress provide functions for dealing with what happens when you chop up text in the middle of some HTML (it closes all open tags), but nothing for de...
when i use
array_map('mysql_real_escape_string', $_POST);
it display
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in D:\xampp\htdocs\...\...\xyz.php on line 14
what is the reason after that?
EDIT:
and if i use
array_walk_recursive($_POST, 'mysql_real_escape_string');
then it display
W...
I have a small existing PHP site that I would like to integrate with a social network software. Essentially, adding my 3-4 pages inside an existing social networking site for functionality such as user management, groups, and friending. I have looked at Dolphin, Pligg, and Elgg but am struggling to find something that I can integrate w...
Is there any way to have an array with items like:
$array[1];
$array[3];
$array[4];
Be turned into an array like this:
$array[1];
$array[2];
$array[3];
So that the array has only sequential numeric keys? Thanks!
-iMaster
...
Hi,
I am going to upload all of my photos to an Apache web server - they're all in folders & sub-folders. Filenames are not descriptive and I don't care about the meta data.
I've worked with PHP Gallery before, but find the process of creating albums, etc. a little laborious. I just want to rsync my local photo folders with my web site...
I need a little help here. This code correctly displays every format I enter--except when it's xxx.xxx.xxxx
It keeps the periods in! How do I filter out periods too?
preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "$1-$2-$3", $phone_enter)
...
I wanted to make a new php web application and if I follow the following things,
it my site then safe?
Escape user input ($_GET && $_POST) with addslashes
Make prepared statements with PDO
Check user input for the right type (e.g. int or string)
...
I am wanting to throw custom errors in many places in some interfaces that I am building. Just using an echo inside my function places that echoed code above the tag in my page. So, I built a custom function to handle errors and give me a backtrace, but again, it prints above the in my page.
Here is the function I am using:
functio...
The following is the part of a script, where i sent some values to a php-file:
var order2 = $(ui.item).attr(\'id\') + \'&action2=insertList&feuser='.$feuser.'\';
$.post("index.php?eID=moveitems", order2,
I know how to read f.e. the value of "action2" in the php, it s easy done with "$_POST['action2'];". but how to read out the valu...
Can I use a PHP 5.3 .user.ini file to pass information other than existing PHP settings? E.g.
display_errors = On
include_path = /usr/myapp/classes
myapp_config_dir = /usr/myapp/config # <-- this is not a PHP setting
...
Hi,
I am trying to set a default value for the location field of a location element in a Drupal form. I have figured out how to set default values for all of the other fields (address, additional address, city, state, zip, country) but can't figure out how to set the actual location default. My code:
$settings = array(
'multiple' =...
I am trying to add some logic to a wordpress template.
I want to build a simple if conditional which will check if a variable equals 26.
The variable "$value" must contain some extra hidden characters, because when I echo the content... 26 appears before the echo string values that should appear first.
Therefore, the if-condition does no...
I have the following code that works:
<script type="text/javascript">
$(document).ready(function() {
// Initialise the table
$('#table_1').tableDnD({
onDrop: function(table, row) {
$.tableDnD.serialize();
$.ajax({
type: "POST",
url: "test.php?"+$.tableDnD.serialize(),
data: "",
success: function(...
I have a complex algorithm that I try to code in PHP but it's a bit complicated for a beginner like me. So I need your help guys
I have an array of unknown numbers starting fron t1 up to tn. I don't know its length actually.like
(t1,t2,t3,t4,.....,tn)
And I want to test a condition on the first elemnt if not, on the last element if no...