php

Excel embedded in a php page

I have a client who wants to be able to embed an Excel document (one that is currently sitting on the same server as the HTML document) like how you would embed a Flash app on a page. I'm correct in assuming this is not possible, right? Please confirm/deny so we can hopefully move on from this because he seems to think this is possible...

Securing input of private / protected methods?

Hello, normally, all sane developers are trying to secure input of all public methods (casting to proper types, validating, sanitizing etc.) My question is: are you in your code validating also parameters passed to protected / private methods? In my opinion it is not necessary, if you securize properly parameters of public methods and ...

mysqldump doesn't run correctly

I write some code with PHP to backup database. Here my code: exec("mysqldump --opt -h localhost -u root test > mydb.sql"); But I get 0-byte in my file (mydb.sql). I also run with passthru(), system(), but it still gets 0-byte. I try to use command. It works. I use the lastest XAMPP for my localhost. So, how can I do to make it wor...

undefined index mode, which is the variable that case statement is looking for

receiving error: PHP Notice: Undefined index: mode in /web/ee_web/include/form-modal.php on line 51 line 51 switch($_GET["mode"]) { block of code it is in: switch($_GET["mode"]) { case "login": login_user(); break; case "logout": session_destroy(); print "<p>You are now logged out.</p>"; print "<p><inp...

Get Video Links from Youtube Channel, extract video IDs from Urls and store them in an array

Hi there, This is my first question on this site. I'm new to php but i've followed advice and gotten my hands as filthy with it as possible. Unfortunately now I'm a little stumped with this simple Youtube app i'm trying to create. I know there are a several related questions out there, but i haven't yet found a comprehensive soluti...

Fatal error: Call to undefined function msg_get_queue()

I am trying to run a script on my local machine, I am on MAC OSX leopard. I have PHP 5.2.x installed and Apache2. I am trying to test this script but I keep getting this error. I googled around a little and saw something where it said it might only be available on linux/unix machines but I find that hard to believe. ...

multiple file upload script not working in php

Hi im using java script to upload multiple images but some how its no working ...only the first file gets uploaded. javascript works standalone but when i integrate it with my existing code it doesnt. im refering the same php file after submit and then using if($_REQUEST['Submit']). i have tried fixing the number of elements it works......

apply_filters() function in wordpress

hey guys im really frustrated im looking for a way to retrieve back my slug to the normal text as wordpress does in wordpress there is a function to do so : apply_filters('editable_slug', $slug) i search all related files to find what this function does, but couldn't understand a bit. as ypu may know , making a slug out of a nor...

Searching Arrays, array_search() issue

Is there any way I can search an array for a value and return it's key, I tried array_search() with no success... below is an example of my array [0] => Array ( [value] => [text] => All Call Types ) [1] => Array ( [value] => enquiry [text] => Renovation Enquiry ) [2] => Array ( ...

Converting TIMESTAMP to unix time in PHP?

Currently I store the time in my database like so: 2010-05-17 19:13:37 However, I need to compare two times, and I feel it would be easier to do if it were a unix timestamp such as 1274119041. (These two times are different) So how could I convert the timestamp to unix timestamp? Is there a simple php function for it? ...

PHP simplexml Entities

What's going one here? $string = <<<XML <?xml version="1.0" encoding="UTF-8"?> <album> <img src="002.jpg" caption="w&aacute;ssup?" /> </album> XML; $xml = simplexml_load_string($string); // $xmlobj = simplexml_load_file("xml.xml"); // same thing echo "<pre>"; var_dump($xml); echo "</pre>"; Error: Warning: simplexml_...

Different data for different dates

I am making a web page which will allow users to input and view data for different dates, and to change the date, there are two buttons, one of which will display the previous day, and one which will show the next day. I know that I can do this by submitting forms and reloading the page every time they press one of these buttons, but I ...

Posting status via Facebook's graph api

In PHP, I am trying to post a status to our Facebook fan page using the graph api, despite following the intructions facebook give, the following code does not seem to update the status. Here is the code; $xPost['access_token'] = "{key}"; $xPost['message'] = "Posting a message test."; $ch = curl_init('https://graph.facebook.com/{pag...

Browser Not Reading Entire XML File

I have an XML file that is written by a PHP script. The data for the XML file is gathered from several different RSS feeds. The PHP script is invoked every 5 minutes by a Cron Job. The PHP Script takes maybe 5-10 seconds to write the XML File. Here's the problem: After the XML file is written, I can open it through DreamWeaver and read ...

when i write options of the selectbox from different php page with jquery,it fails!

Hi i am developing a web app.I am retrieving options of the select box from database and i want to write these records to selectbox.My page structure is like that: main.php=>there is a selectbox in this page <select id="my_select"></select> retrieve_data.php=>i make a ajax call to this page and this page gets the phone numbers from ...

How many bytes does Oracle use when storing a single character?

I tried to look here: http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i3253 And I understand that I have to provide string length for the column, I'm just not able to find out how many bytes oracle uses when storing a character. My limit is 500 characters, so if its 1 byte / character, I can create the colum...

Add attribute to an object in PHP

How do you add an attribute to an Object in PHP? ...

restrict the scope of variables in a mysql query? with brackets?

I can't remember what the method is meant to be for ensuring the scope of a variable in a query is restricted to prevent mysql injection. where should i put brackets in the following examples? UPDATE table SET col_1 = '$var', col_2 = '$var2' WHERE col_1 = '$var3' and SELECT * FROM table WHERE WHERE col_1 >= '$var1' (Obviously look...

select attribute mysql

I have there mysql table: **product (id,name)** 1 Samsung 2 Toshiba 3 Sony **attribute (id,name,parentid)** 1 Size 0 2 19" 1 3 17" 1 4 15" 1 5 Color 0 6 White 5 7 Black 5 8 Price 0 9 <$100 8 10 $100-$300 8 11 >$300 8 **attribute2product (id,productid,attributeid)** 1 1 2 2 1 6 3 2 2 4 2 7 5 3 3 6 3 7 7 1 9 8 2 9 9 3 10 And listed...

Uploadify Hanging at random on 100%

I am using Uploadify to enable my users to upload images via my web application. The problem I am having is that every now and then (at what appears to be random) when the progress bar reaches 100% it 'hangs' and does nothing. I was wondering if any developers familiar with uploadify may have any idea how to solve this? I am in despera...