php

how to insert multiple data with their own type?

<input name="names[]" type="text"/><select><option value="male">male</option><option value="female">female</option></select> <input name="names[]" type="text"/><select><option value="male">male</option><option value="female">female</option></select> <input name="names[]" type="text"/><select><option value="male">male</option><option ...

send over 100 with mail()

Hey I have just over 100 contacts i need to e-mail to while ($row = mysql_fetch_array($result)){ $message = "Hello ".$row['first_name'].", \r\n"; $message = $message.$_POST['message']; if (mail($row['email_address'], $subject, $message, $headers)){ $sent ++; }else{ $error ++; } } Will this run okay? I have looked a...

How to append a string to the content of a error log file in an highly frequented environment?

From my age old php days (years ago) I slightly remember that I had big trouble with creating a log file in PHP. At random times, the file suddenly was plain blank (empty). I used something pretty close to this: $myFile = "myFile.txt"; $fh = fopen($myFile, 'a'); $str = "New Entry...\n"; fwrite($fh, $str); fclose($fh); Is that really a...

How to get an humanly readable string representation of the current date + time in PHP?

It doesn't really matter how exactly it looks like. I try to make an error log class that needs to print some useful stuff into the error notification. A unix timestamp would not be too obvious for the poor admin who's got to fix the bugs ;) ...

Why would some buttons in CK Editor not work?

I am usuing CKEditor (version 3.0.2) in a site that I built. I have used it before in other sites and never had any issues. In the current site any of the buttons that would have opened a JavaScript Popup will not work. Thinks like Bold, Source, Save all work fine. But thinks like Add Image, Link, Anchor, Table, Smiley, Special Character...

php ajax one to one chat problem

i am trying to make php ajax one to one chat.............my problem is that how can i fetch the chat messages from table by both user1 and user2........ my database table has........ id, from, to, text, time fields.............. what would be the query to show the messages from both users with their respective names.... ...

Do I have to explicitly close this file?

I found a logging script like this: /** * Logging class: * - contains lopen and lwrite methods * - lwrite will write message to the log file * - first call of the lwrite will open log file implicitly * - message is written with the following format: hh:mm:ss (script name) message */ class Logging{ // define log file ...

Alternative to mod_expires for setting expiration headers?

I am using php on an Apache server. I am unable to set expiration headers in .htaccess on the server that I am working on, as it is a shared server and they (the web host) will not install the mod_expires module in the apache build. I have always used the "ExpiresActive On" and set the default cache expiration for images, js, xml and tex...

Path Confusion: Does require, include, fopen etc. take all their paths the same way?

I slightly remember from age old PHP days (years ago) that different functions wanted to have different paths. I mean...starting from different points. Some were relative, others absolute, etc. How about fopen? Is that the same thing like require? Same path in same situation? ...

log_errors_max_len = 1024 in php.ini, but php log keeps growing

As the title says, I've set the max length for the php error log, but it seems to keep growing much much larger than 1024. I am using the correct php.ini, I've restarted apache, etc. The permissions on the php log are 666. ...

How do thumbs up in comments work?

I don't even know what questions I should ask. Well, I want to create a thumbs up for my comments, but not sure how or what's the best way. Do I just create a new field for thumbs up? ...

Will <insert popular website here> restrict me from accessing their website if I request it too many times?

I ask this because I am creating a spider to collect data from blogger.com for a data visualisation project for university. The spider will look for about 17,000 values on the browse function of blogger and (anonymously) save certain ones if they fit the right criteria. I've been running the spider (written in PHP) and it works fine, b...

replacing certain images with certain words..........

i want to change the word :)) to a smily img before displaying it from database with php how can i do that ...

mysql DB not adding rows with similar elements

i have created a DB with 3 columns: aid, qid and message. aid is a foreign key which will be commond with another table. comments is a varchar which stores user comments its partially working. the problem is aid is not adding duplicate values. suppose i want to add comments related to specific aid. there are 18 aid's in all. and i wa...

Are numerically indexed PHP arrays initialized contiguously or mapped?

Hello, I have a question in regard to PHP arrays. If I create an array $ids = array(); then put something in position 1000 of it: $ids[1000] = 5; How would the interpreter do this internally? Are arrays contiguous lumps of memory like Java? Would it be like int[1000] where 1000 ints are initlialized? Or is it more of a map wher...

Grid View using javascript or in PHP

Hai, I need a simple grid view with horizontal and vertical scroll bar using Jquery or simple javascript or in php, can anyone suggest me a simple grid view plugin? ...

How can I make set_error_handler() call a method on an object?

I think about using the set_error_handler() functionality in PHP to handle most of the PHP errors in one place (logging them to a file). From the documentation it looks like if I can pass a function name to set_error_handler(). Nice! But I have an ErrorManager object which has a nice logging method. I want to use that ErrorManager object...

Does set_error_handler() work on most cheap virtual webspace hosting accounts?

I'd like to use set_error_handler() to handle all PHP errors in one place, but I'm afraid that this is something I can't use with cheap webspace hosters. Or must I not worry much about that? ...

php ajax chat problem

This is my php code........... $root = "http://localhost/"; $sql = mysql_query("SELECT * FROM mychat WHERE (too='$mid' AND froom='$uid') OR (too='$uid' AND froom='$mid') ORDER BY id ASC"); while($ro=mysql_fetch_array($sql)){ $from = $ro['froom']; $to = $ro['too']; $text = $ro['text']; $time = $ro['tim...

PHP code to restrict member access by permissions

Hi, I am building a website in PHP & mySQL. It has frontend and backend capabilities. Only admin can enter the backend by means of username and password. Now if the admin wants to add other sub-admins to the website, he could do so. By this method, a sub-admin will be able to login and perform all actions that the original admin is able ...