php

Should I split the data between multiple databases or keep them in a single one?

Hi, I'm creating a multi-user/company web application in php & mysql. I'm interested to know what the best practice is with regards to structuring my database(s). There will be hundreds of companies and thousands of users of this web app so this needs to be robust. Each company won't be able to see other companies data, just their ow...

Sanitize file path in PHP

Greetings, I'm hoping to make my tiny program secure so that potential malicious users cannot view sensitive files on the server. $path = "/home/gsmcms/public_html/central/app/webroot/{$_GET['file']}"; if(file_exists($path)) { echo file_get_contents($path); } else { header('HTTP/1.1 404 Not Found'); } Off the top of my head...

Solid white screen after a simple PHP search query even though there is html

I'm making a very simple search program for my database. When I run the query, if I search for data that I know is there, it returns the info I wanted it to and displays it. If I enter data that I know does not exist, it goes to a solid blank page even though there is html behind it. Why? Any clue? I wish I had a better way to descri...

Group select boxes into array for post?

I know how to send data via a multi-select form object and group the data into an array: <select name="my_data[]" multiple="multiple"/> Is it possible to have multiple different select boxes with "single" values and push them all into an array? i.e. <select id="select-1" name="my_data[]"/> <select id="select-2" name="my_data[]"/> r...

Markdown vs. HTML in a CMS

I'm working on a fairly large CMS-like app that includes a forum, wiki pages, etc. What whould you chose between Markdown and HTML? I'm concerned about usability and the fact non-techie people will use this. Markdown has a very simple syntax but few users know it with HTML you can use a WYSIWYG editor but they are often terrible ...

How can I convert flv file to a mp3 file by using php?

How can I convert flv file to a mp3 file by using php? ...

INSERT command inserting duplicates

I am writing a quiz website. What should happen is: A page has a question on it and four buttons or a textbox. When you click a button, it calls itself with the answer number in the address like: ?q=[question number]&a=[answer]. If the question uses a textbox it POSTs the answer. This code should then detect that something has been...

Should I be binding individual array entries, or just executing the array with PDO

I have an assoc array filled with the values necessary for a PDOstatement. Should I, bind each value then call execute? Or call execute passing it the array of values? Array( [name] => Joe [value] => some content ) Should I: foreach($data as $key => $value){ $statement->bindValue($key, $value); } execute(); OR execute($data...

Stuctures of Complex and enterprise level applicaitons

I have a problem about structures of the complex applications .Because my knowledge background does not come from education , i have had always problem about application's layers , design patterns and programing structures.First of all , I can do whatever I want with php , because I know common functions and I have experience with php. B...

All users blogs browsing from default BuddyPress theme (WordPress MU)

WordPress MU.. I want to use BuddyPress as a social network only (keeping blog creation and editing functionality) but preserving users from browsing their blogs from anywhere but default BuddyPress blog\theme so that if this is default link to some user's blogs ( wp/members/dreadnought/blogs/ ) this will be link for his posts ( wp/membe...

Segmentation fault in Zend_Tool

I'm using Ubuntu 9.04 and I applied this tutorial But I'm still getting this error: berkerpeksag@berkerpeksag:~$ zf show version Segmentation fault What do I miss? Thanks. ...

How to delete all cookies in PHP?

setcookie('id', null, 1, "/", ".domain.name"); The above will only delete a specific cookie,but how to delete them all? And if I've set cookie[person][name], cookie[person][id], cookie[person][age],how to unset cookie[person]? It's actually 2 questions. ...

I want to use the same image more than once and I would like the web browser to download this image only once, how to do it?

I want to use the same image more than once and I would like the web browser to download this image only once, how to do it? ...

How to assign multiple dimensional array in cookies with PHP?

cookie[person][name], cookie[person][id], cookie[person][age] How to make the cookie like above? ...

Zend: Creating models for a products table

I'm trying to create two models, products and product_manufacturers so that I can pull in manufacturers as well as products, edit them in the admin if necessary, and the usual CRUD stuff. Here's the schema for the tables ( it's not finalized so if you have any suggestions go ahead ). CREATE TABLE `product_manufacturers` ( `id` int(11)...

Does PHP Error_reporting(0) have any effect on logging information?

Should error_reporting(0) have any effect on error logging (to file) or does it just suppress on screen error displays? Thanks. ...

Form Submission- success

Hey guys, well I have a very weird Form Submission problem on which I wasted days and still cannot figure it out: 1) when I fill in the form properly (for a new user) works well 2) if I try to register a user with an existing email... it just refreshes instead of throwing an error 3) if I submit the form after a failed attempt I do not ...

"Warning: Cannot modify header information - headers already sent by" error

i keep receiving this error each time i try to submit the a form deletion form. Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\speedycms\deleteclient.php:47) in C:\xampp\htdocs\speedycms\deleteclient.php on line 106 is there something wrong with my code? what do i ...

I need to get paypal confirmation to php

I need to get paypal APN to be convert to php so that I can get mysql database updated with sales.Can anyone help me with this. ...

XML with xpath and PHP: How to access the text value of an attribute of an entry

xml: <entry> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/xy/albumid/531885671007533108" /> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/xy/Cooking" /> <link rel="self" type="application/atom+xml" href="http://picasa...