php

Facebook PHP API Calls

Hello, So I simply want to add my current facebook status to my personal website. I have been looking at tutorials and other posts about fb and fb connect, but I am still confused. Is there anyway to do this with simple REST calls? Like twitter or flickr? From what I understand I dont need FB connect because I am just getting my own ...

PHP Zend Debugger configuration

Hi i am new to php, I currently learning php using eclipse. I know i have to install the zend debugger my php.ini store at c:windows i had added in these line: [Zend] zend_extension=c:/php/ext/ZendDebugger.dll zend_debugger.allow_hosts=127.0.0.1 zend_debugger.expose_remotely=always zend_debugger.connector_port=10013 but on command pro...

php file_get_contents and &

Hello all, I'm trying to use php's file_get_content('a url'); The thing is if the url has '&' in it, for example file_get_contents('http://www.google.com/?var1=1&amp;var2=2') it automatically make a requests to www.google.com/?var1=1&amp<no space here>;var2=2 How do I prevent that from happening? ...

How do I impliment a hidden field in a post form so users can't accidentally double post? (PHP/Mysql)

When users submit a form, they will sometimes click refresh or backspace then resubmit which causes multiple entries in mysql. How can i prevent mysql from allowing more than 1 of the same entry? People suggested a hidden field with a value, but how do I use that? <label for="state" class="styled">State:</label> <input type="tex...

A Question About Embedding HTML In PHP

Hello all Some time ago I read a posting on a board where the person was talking poorly about people that have HTML embedded/within their PHP. I do quite a bit of PHP development but I still interleave HTML and PHP in the same document. Is there a better way to do this, am I doing it wrong? I know that in JSP/JSF they use an XML documen...

Do all header("Location: member.php?id=$username") have to be the first thing in a script? (PHP)

I know in the Manuel it says that the header has to be the first thing in a script, but how come I see some codes where header("Location: member.php?id=$username") is in a if-statement? Ex: //a bunch of codes above if($result!="0"){ // authenication correct lets login $_SESSION["password"] = $password;; $_SESSION["username"] = $usern...

How to access the members of this data in PHP?

Okay. Now I give up. I have been playing with this for hours. I have a variable name $data. The variable contains these contents: (extracted by using var_export()) array ( 'headers' => array ( 'content-type' => 'multipart/alternative; boundary="_689e1a7d-7a0a-442a-bd6c-a1fb1dc2993e_"', ), 'ctype_parameters' => array ( ...

How to redirect output of PHP script DURING execution?

Is there a way to redirect output of an executing PHP script? Of course this is trivial when launching the script via the command line. But how is this accomplished after the script is started? Note: I need to capture the syntax errors and such as well. ...

File version maintainence via PHP FTP?

Currently I'm working on a "plugin" that will be installed on many different sites and I was wondering on the best way for me to maintain the file version of this "plugin". Here's what I was thinking. Have a "master copy" of the plugin on a server, then connect via FTP to the target sites and upload the copy to their site overwriting wh...

php and mysql listing databases and looping through results

Beginner help needed :) I am doign an example form a php book which lists tables in databases. I am getting an error on line 36: $db_list .= "$table_list"; <?php //connect to database $connection = mysql_connect("localhost", "admin_cantsayno", "cantsayno") or die(mysql_error()); //list databases $dbs = @mysql_list_dbs($connec...

How to substr html entities properly?

Hi everyone. I have like this : $mytext="that&#039;s really &quot;confusing&quot; and &lt;absolutly&gt; silly"; echo substr($mytext,0,6); The output in this case will be : that&# instead of that's What i want is to count html entities as 1 character then substr, because i always end up with breaked html or some obscure characters at...

How to have one PHP script launch another and capture its output?

This is a little tricky so bear with me: I have a PHP script a.php that is launched from the command line and data is provided to it via STDIN I have another PHP script b.php I want to have a.php launch b.php and capture its output. Also, a.php has to forward the STDIN to b.php Is there an easy way to do this? ...

Passing sql results to views hard-codes views to database column names

I just realized that i may not be following best practices in regards to the MVC pattern. My issue is that my views "know" information about my database Here's my situation in psuedo code... My controller invokes a method from my model and passes it directly to the view view.records = tableGateway.getRecords() // gets array of record...

private home proxy server

How do I make a proxy site for a home URL (EX: 192.168.1.190) to bypass the web filter we have set? Don't worry, I am in cahoots with the person that monitors this stuff, so this is for that person. Thanks! ...

Are there any alternatives to shell_exec and proc_open in PHP?

It seems like I can't use shell_exec or proc_open on my shared server. The message I get when I try to use it is: Warning: shell_exec() has been disabled for security reasons in /home/georgee/public_html/admin/email.php on line 4 Are there any alternatives to these functions? ...

OOP in PHP: Class-function from a variable?

Hello Is it possible to call functions from class like this: $class = new class; $function_name = "do_the_thing"; $req = $class->$function_name(); Something similar solution, this doesn't seem to work? Martti Laine ...

Multiple calendars on wordpress highlighting only specific categories

Does anyone know of how, in wordpress, I could implement many calendars on a site, each only highlighting days that are within a specific category? I am hoping to setup multiple calendars, each tracking all of the events from their own cat. After researching for a while the best I could find was this thread: http://wordpress.org/suppor...

is it possible to crawl an videos from an video site like youtube

is it possible to crawl an videos from an video site like youtube http://www.truveo.com/..... ...

PHP Menu Items Count then add under more button

Hello, I use the bellow code to load the main menu elements from some CMS, the present code is perfect except that it loads ALL the main items on a single line of menu - which will make the width of it unusable in any centered design (under 1000px).. I want to change this script so after 15 main elements will add a "MORE" button under w...

Inserting checkbox values

hey i have registration form that has checkboxes along with other fields. i cant insert the selected checkbox values into the data base. i have made one field in the database for storing all checked values. this is the code for checkbox part in the form: <pre><input type="checkbox" name="expertise[]" value="Websites,IT and Software"> We...