Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





CSV File-based Address Book Code Snippet?


Since I'm a PHP newbie and the only address book apps I found
through Google require MySQL or PostgreSQL, I figured I'd ask if
someone has come code handy.

I'd just like to keep a list of addresses in a CSV file (ie. columns
last name, first name, e-mail, office #, etc.) so as to ease backing
up, and read/update this list from a PHP script.

I guess it's pretty much just a loop to read + parse, and a form to
update, but if someone has the code handy, I'm interested :-)




View Complete Forum Thread with Replies

Related Forum Messages:
Using Snippet Of Code From Url Address
I have a form that has an url in the address line as follows;

'quoter.php?wtype=f10'

My images are kept in a folder called 'images_1'. Each image is called f1.jpg, f2.jpg etc. Where the 'f10' is shown in the url can I use that part of code to display my image f10.jpg. Basically to bring f10 into my code and put an extension of .jpg at the end of the line to display the image.

View Replies !
Code Snippet
what is wrong with this code snippet. I actually can't find it out(still working) PHP Code:

<?

for ($i= 10; $i<20; i++) {

var $txt= 'U are cool'

echo 'Txt do be written $txt

'...

View Replies !
Decipher A Code Snippet?
This is a function a previous programmer made for my website. I am trying to figure out all his code, but I just don't understand what this particular snippet might be trying to accomplish. I know it has something to do with page formatting, but I'm just having trouble deciphering it. Code:

View Replies !
User Address Book
I want to create or buy a script that allows any user to open an account for there own address book (mainly email addresses). Every user will have their own username and password. Besides that, I have a test input in my site that you need to fill up the email address. What I want to create is a small button near it which will open a new small windows to select an email address from the users' address book.

View Replies !
Address Book Grabber
I am PHP developer, developing a community network and desprately looking for a PHP script which imports email address from address books of Yahoo Gmail Hotmail and AOL. Any1 who could help me with this ? I dont have much money to buy this script or any one who could mention any cheap web site to buy this script ?

View Replies !
Can You Check My Short Code Snippet
I want users to be able to create an image from either an image template on my site (labelled $im) or by entering in a url.I think i've worked it out, but my php is not very good so can you tell me where i'm going wrong with it please? Code:

View Replies !
A User-accessible Address Book Using Php?
I still can't figure it all out.

I am trying to create a web page (using php) where:

1) A visitor add his or her name to an address book that can also be
viewed online by other visitors to the website.

In creating this, I will also need to:

2) Allow that visitor to create a username and password to add his/her
information.

3) Allow that visitor to make changes and updates to his or her entry in
future visits to the website.

and...

4) Create an automated system for that user to retreive his/her username
and/or password if s/he has forgotten it.

Boy oh boy, would I be happy just to be able to make step #1 a reality.
Can anyone please help me with this? I am leasing space from Aitcom and my
server is a Linux system. I have MySQL and PHP available to work with.


I have an example in mind. The following website is another school very
similar to ours in Maine, and they have a system in place almost exactly
as I'd like to create:

View Replies !
LDAP To Display Address Book
Basically I am a newbie to some scripting but I have tried some scripts with variable success. Basicallly what I would like to do is make a company directory (HTML or some other webbased process) that auto updates from active directory through the form of LDAP (or any other kinda that you all can suggest) A directory that contained items such as name, email, phone, etc. We are on a 2003 network so I know that the LDAP has to be binding. Any ideas or at least a good push in the right direction? I have tried other's scripts and either it pulled all the information from activate directory or just a single user. Also is there a way to include this script information in a webpage formatted that way it can have a readable look to it?

View Replies !
Address-book Type Project
I have since 3 days been trying to display the results from mysql database at my website in a table format. I also need to have a form so users can fill out their data,which would get posted to the database. Also, that options should be possible to view the tabulated results by

a] filtering the data
b] view data by sorting on various fields

I only got as far as creating the database and am able enter info directly [this was easy]. THAT IS IT! I have followed several tutorials from many websites,with drastic results. Either I get a "access denied" when I make scripts to connect to the database.

[edited by: coopster at 3:14 pm (utc) on Aug. 19, 2004]
[edit reason] no solicitations please [/edit]

View Replies !
Read Outlook Address Book
Using PHP 4.3.3, I want to read the Microsoft Outlook address book. Can anyone help me in this context?

View Replies !
Code Snippet Who Test If A Cookie Exist
I got a simple page index-tmp who include a code snippet who test if a cookie
exist and if yes redirect to the user account page but the trouble
is when I didn't 've a cookie the page still redirect to the user account page.

here is the following code :

<?
$cookie = $_COOKIE["free-nickname"];
if (!cookie == null) {
echo '<script langage = "javascript">'
echo " document.location.href = 'index_utilisateur.php'";
echo '</script>;'
}
else {
echo '<script langage = "javascript">'
echo " document.location.href = 'index.php'";
echo '</script>;'
}
?>

View Replies !
Contact List Or Address Book Repost
Posted this incorrectly as a response in an unrelated thread. Sorry!

I've looked at many that are available, but would like to solicit other
ideas.

I am looking for a solution to manage and make available the 1000's of name
and numbers that a family accumulates. I want to make this information
available away from the home, and have a host with:

PHP Version 4.3.3
Mysql Version 4.0.15-standard

Php-projekt seems to have the features in Contacts that I would like,
especially import and export. I would like something with a simpler
interface, though.

Is there a PHP book that might cover something like this?

I don't have the programming experience to do this, of course, but maybe I
should attempt it.

I've rambled on a bit, but think this is a topic that many people are
interested in.

View Replies !
Modifying Data In Address Book With PHP And MySQL
I'm working off a tutorial on building an address book with mysql and php. For a reference you can find it here:

http://php.about.com/od/finishedphp1...dress_book.htm

I'm having no problems with creating the database in sql, I've entered some sample data into the table with phpmyadmin, and the code below will correctly display the info on the page.

The problem I'm having is modifying the data. Whenever I click on the add contact, edit, or remove links, nothing happens. Sure, the url in the address bar will change from www.mysite.com/address.php to www.mysite.com/address.php?mode=add when I click on the add contact link, but no form appears so I can input data. Code:

View Replies !
Getting Address Book Of Hotmail, Gmail, Yahoo
i want to get address book of hotmail, gmail, yahoomail, and msn using php curl coding.

View Replies !
Adding Arrays - Snippet Of Code To Deal With The Insert-part
I'm doing a one-time operation of importing something from a textfile. My bet was foreach() but I'm unsure of the code itself, so I'd appreciate a snippet of code to deal with the insert-part Here's the code of the field which produces about 400 rows. PHP Code:

View Replies !
IP Address Redirect Based On Country
I'm looking for a solution to redirect a user based on his/her IP. I have servers in Asia and servers in the US. A few of my pages are on a US based server which is the primary or root domain name if you will. However when these pages are accessed from China for example, I would like to serve them pages from my China server (my subdomain). by having the page detect their IP and knowing whether it is based out of China or the US. Is this possible?

View Replies !
Serving A Website Based On Source Internet Address ?
Based on the source internet address a different version of the website
should be presented/served to the user/browser.

I would like to keep the script as simple as possible and it should
replace the index.php.

The script could look something like this in pseudo code:

if SourceAddress = â¸.3.5.1' then
begin
ShowBlueWebsite; // load/show BlueIndex.htm
end else
if SourceAddress = ït.5.15.7' then
begin
ShowRedWebsite; // load/show RedIndex.htm
end;

Is this possible with php ?

View Replies !
PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example:

index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>.

I've done this before, but I can't remember the code I used.

View Replies !
PHP Based Email Address Obfuscator For Website Mailto: Tags
I found a PHP based email obfuscator for use in websites, where the
source HTML (PHP, actually) file doesn't contain the actual email
address in the Mailto tag, but generates it and that generated page
(containing a full and conventional Mailto: tag) is what is ultimately
presented to the user.

The intent is to thwart Spam bots and spiders, by NOT having the email
address in the original HTML Source, but ultimately presenting it to
the person browsing the site.

But here's my question.... Even though the program works exactly as
advertised, isn't this a case of flawed logic on the part of this
scripts author? PHP runs server-side, so won't the PHP be
interpreted, whether it's requested by a bot, a spider, or a legit
website visitor? (and thereby, presenting the bot with the full
Mailto: tag and email address anyway)? Or is there something basic
I'm missing here?

View Replies !
Import Yahoo,msn,Gmail Address Book Contacts For Particular Yahoo,msn,Gmail Email Id
I am trying to import the yahoo, msn,gmail address book contacts for the particular yahoo, msn, Gmail Email ID's. The process is first entering the yahoo, msn, or Gmail email id and password and after submitting the form, i am trying to get the yahoo, msn, Gmail address book contacts for that particular email id.

View Replies !
Book Script ,should I Use Txt File Or Mysql Text Field ?
I am doing simply book script, where we will have hundred of books,user will be able to read chapter by chapter or search etc.. As u know that book contain will have html tages..etc.. and each book is around 200 kB....My php script read text file and display. It's a huge text file.

I am thinking to use database instead of text file. But text files are very huge. My question, should i use database instead of text file ? which one is faster and better.

I have noticed, when i copy 150 kB files and paste into phpmyadin, it gives me internel error..but it insert record. I used txt field for book contain.

View Replies !
E-mail Address Restrictions Code
I'm having a little trouble with a code I'd like to implement into a script. I've looked around and found some answers, but not really a complete answer to what I was looking for. What I'd like to do is only allow people whose e-mail address matches a certain pattern to be able to create an account. Now I know the code is suppose to go something like this: Code:

View Replies !
Code To Change Display Based On Refer
I just setup a SSL key for one of my domain names. However I have some images that are not on https:// so it brings up warning errors. Id like to be able to use some php code to see if its requesting https:// and if so display something else in its place.

Can this type of thing be done with https:// or is it just file type or domain specific?

View Replies !
Run A Small Code Block Based On Whether A Checkbox Is 'checked' Or Not.
I want to run a small code block based on whether a checkbox is 'checked' or not. I tried gathering the global using post and a submit for checked as both 'checked', '' and true/false, as well as 1 or 0.

Is there another way to approach validating checkbox values? I thought about running some eval() tests on the value to see what the return is (string, bool or int) but didn't quite know how to test it.

View Replies !
Code Review: Does This Class Method Really Validate An Email Address?
I wrote a method that should check if an email address is valid. In
another method I've already checked to see if $_POST['email'] exists
and is well-formed, so those checks are not necessary in this scope.

However, "Step 4" bothers me, and I wonder if others are as bothered as
I am.

[PHP]
/**
* Validate submitted email
*
* @access private
* @see checkdnsrr
* @link
http://www.devshed.com/c/a/PHP/Email-Address-Verification-with-PHP/4/
* @see link regarding use of getmxerr() as a double-check behind
checkdnsrr
* @link http://us2.php.net/manual/en/function.fsockopen.php
* @see link regarding usage of fsockopen() for domain reachability
verification
*/
function &validateEmail() {// STATIC VOID METHOD
global $webmasterEmail;

list($user, $domain) = @explode('@', $_POST['email']);

if ($this->isValid && (!$user || !$domain)) {
$this->isValid = false;
$this->setErrorArray(array('email' => 'No validly formed email
address was found'));
}

// STEP 1: USE checkdnsrr (either built-in UNIX version or
"homegrown" version in client functions.inc.php for Windows)
if ($this->isValid && !checkdnsrr($domain) && !$_ENV['windir'] &&
!$_SERVER['windir']) {
// ONLY PRODUCE AN ERROR IF NOT IN WINDOWS ELSE ALLOW getmxrr() TO
THROW ERROR
$this->isValid = false;
$this->setErrorArray(array('email' => "Domain: "$domain" not found
to exist for email address to be valid"));
}

// STEP 2: MAKE SURE $domain IS NOT OUR DOMAIN
if ($this->isValid && strcmp(trim($domain),
preg_replace('/^([w]{3}[a-zA-Z0-9]*).?([a-zA-Z0-9-_.]+)$/i', '$2',
$_SERVER['SERVER_NAME'])) == 0) {
$this->isValid = false;
$this->setErrorArray(array('email' => "You are not allowed to use
our domain of "$domain" for your email address"));
}

// STEP 3: USE getmxrr() BUILT-IN PHP FUNCTION TO DOUBLE-CHECK BEHIND
STEPS 1 AND 2
if ($this->isValid && @!getmxrr($domain, $hostArray)) {
$this->isValid = false;
$this->setErrorArray(array('email' => "Domain: "$domain" is not
found to exist for the email address to be valid"));
}

// STEP 4: VERIFY VIA fsockopen() IF YOU CAN EVEN REACH THAT DOMAIN,
MEANING IT'S ACTIVE (COULD ALSO BE DOWN OR UNREACHABLE OR BOGUS)
if ($this->isValid) {
$socketID = @fsockopen($domain, 25, $errno, $error, 15);// LAST
NUMBER IS TIMEOUT FEATURE - TIMEOUT AFTER 15 SECS
if (!$socketID) {
$msg = "There was a problem attempting to connect to "$domain": "
.. nl2br($error) .
", please try again or contact our administrator at <a
href="mailto:$webmasterEmail">" .
str_replace('@', ' at ', $webmasterEmail) . '</a>'
$this->isValid = false;
$this->setErrorArray(array('email' => $msg));
}
@fclose($socketID);
}
}
[/PHP}

View Replies !
Login Snippet
I would like to create a login feature for the Site Admin i.e Me and fellow DJ´s.

But i want it so, when we log it, a picture on the index.html page (DJ Playing Now) will change to the corresponding one. I.E when i log in it displays "djscousey.jpg"  when MC MiniMat logs in it displays mcminimat.jpg etc. etc.

I really am a learner at php, so i thought maybe you guys could put me in the right direction..

View Replies !
Small PHP Snippet
As you can see from the code below its reading from the database fine, it will show two of the first entries in the db. Theres a small peice of code i remember but cant find it, where you can add to the bottom of the script where if there are new entries it will add to the list automatically. Code:

View Replies !
With PHPrint Snippet
I am trying to use the snippet (791) "PHPrint" with my web pages in order to make printer friendly pages. I have followed the provided direction, I think. When I tried to print, I get a infinit loop stating that

"feof(): supplied argument is not a valid stream resource in d:server....PHPrint.php", line 65

and "fread(): supplied argument is not a valid stream resource in d:server....PHPrint.php", line 66"

View Replies !
Debug Snippet
Thi this seems like a correctr code, but ti doesn't quite work. Can anyone see what the problem is? PHP Code:

foreach ($array as $key => $value) {
echo "<input type=checkbox name='".$key[i]."'";
    if ($array[i] == $key) { echo " checked"; } echo ">".$value; }

View Replies !
Xpdf - PHP Script Or Snippet
Will appreciate any example of subject script calling xpdf, any platform...

View Replies !
Search Snippet Generator
I'm coding a script that searches a MySQL DB. On the results page I would like to include page snippets with the highlighted search query. I intended to do the snippets similar to Google. how to code this "snippet-generator"?

View Replies !
Rewrite Of Javascript Snippet
it's possible to rewrite the following javascript snippet in PHP? Code:

View Replies !
Who's Online Snippet Codes?
i know this is very common script and i tried the search button for this forum and it shows me very incomplete procedures. can someone show me the snippet codes for this or if possible a good tutorial for this.

View Replies !
Copy($file, $address)
trying to use copy($file, $address) and it throws this back at me...

Warning: open_basedir restriction in effect. File is in wrong >directory >in /home/sites/site170/web/admin/experiments/uploader.php on line 57

is this a permissions problem?

View Replies !
Web Based File Manager
I'm writing here to ask if some one know a free software developed with PHP&MySQL for web files management.

The basic requirements are:

- User Management
- File Permission Management
- File Categorization
- User notify by mail when a new file is inserted or an old file have been modified.

Best regards and sorry for my poor english.

View Replies !
Snippet For Verifying Input Fields
I am looking for a snippet or two that will verify the data passed from a form. For example, verify that the input is a number, or a date, or a valid email address. I hate to re-invent the wheel, so any help would be appreciated. I'm not really lazy, I am just caught up with work and the mechanics of using DB2 with PHP. I'm inputting a string called "amount" and want to insert it into a DB2 field of type "int". (I'm guessing it's the same as in MySql).

View Replies !
Snippet To Verify Input Strings
can someone show me/give me a snippet that will verify that an input string is a numeric value?

I'm using DB2 and would like to verify that a string is integer, dec(x,y) etc. Dates I've been able to find a nice routine (snippet) for, but numeric values seem to elude my searches.

View Replies !
Database Or Flat File Based?
I'm writing a news script, where I can write articles and have them outputted on my homepage. What I'm wondering before I start is; does anyone have any advice whether something like this would be better of stored in a database or flat files?

Some articles could be quite long and I just thought they may be better suited stored in a .txt file for instance, but then again it might not make any difference.

View Replies !
Access File Based On PayPal's IPN?
I have a website where I sell video clips. I want to know if it's possible to give a registered user access (or deny) to download a file (HTTP) based
on his payment to PayPal.

View Replies !
Can I Hide My Email Address In Require File
I am wanting to hide my email address so that a spammer cannot use one of their "crawlbots" to crawl the pages in my web site and steal my email address.

Can a spammer's crawlbot find my email address if I place my email address in an include file and place the include file somewhere like, for example, the configuration folder?

View Replies !
How To Extract An Email-address From A Text File
Can somebody show me a quick code snippet to reliably extract an
email-address form a text file ?

View Replies !
Writes The Email Address To The Text File
I've got a PHP form processor running that sends the forms fields via email and then writes the email address of the sender to a text file on the server.

I've got it working perfectly except when it writes the email address to the text file, it puts them all on the same line. I need to get it to put each address on the next line down. This is probably a pretty simple thing to do but my eyes are bugging after trying for a while now.

Here is the code that writes to the text file:

////////////write to file///////////
$out = fopen("/home/myserver/leads.txt","a");

if (!$out) {
print("Could not append to file");
exit;
}

$T1 = $_POST[$reply_to_field];

fwrite($out,"$T1 ");

fclose($out);

View Replies !
Any Function/script/snippet To Output Only Textual Content From Url?
you may have seen some "search engine spider simulator" tools online that show only the textual content of a web page stripping all html codes, javascript, images etc...

is there any any function/script/snippet to output only the textual content from a given url?

View Replies !
PHP Based File/folder Backup Script
Does anyone know of any OSource scripts to read the file/dir structure and then compress it into one zip/tar/gzip file to then be deliverd to the end user via http/https download.

View Replies !
File Access Based On PayPal Info (IPN)?
I want to let a (registered) costumer download a file after paying through PayPal. Now PayPal have a system called IPN (Immediate Payment Notification), where your server gets notified whether the transaction was approved or not. Based on that notification I want the server to allow or deny access to the file.

View Replies !
Include File Based On Browser Language
i have the next script, and when i trying to run it it show me "Error there is no document by that language." as defauilt. but i have "en" language in my opera browser, please help to fix it. Code:

View Replies !
Would A Cookie + Text File Based Solution?
I wrote a web counter that tracks online visitors. Visits are recorded in a MySQL table. But I am considering switching to a text file.

The reason is that I am getting hundreds of simultaneous connections (I operate more than one counter on more than one site) and my server is under too much stress to keep up. Would a cookie + text file based solution be better in my case?

View Replies !
Create A URL Or A Text Message Based Upon Of File
I have to create a URL or a text message based upon of file exists in a certain directory.
For examle,

if
<test.touch> exists in </home/user> dir
then
message A
else
message B.

View Replies !
Trouble Extracting Email Address From Text File
I'm trying to put together a script that will read an email box set up for newsletter bounces and remove the bad addresses.

There's an old script I've worked with that looks for --- Permanant fatal errro ---, but not all the bounced emails have that line included (3 out of about 700 do).

I need to find the bad address, then delete that address out of the database. I've got the deleting out of database down, but am not sure how to find any email address & delete it.

View Replies !
Dont Want The File Names In The Browser Address Field
Is there a way in PHP where the file name do not appear in the browser address field.

eg. the url of a file is : http://www.somedomain.com/somepage.php.

but when a link to this page is clicked, only http://www.somedomain.com should show up in the browser address field.

View Replies !
Scripts To Read A File And Change All The Url To Absolute Address
For example, if my site is http://www.mysite.com

And there might be a file http://www.mysite.com/news/20051105.html

I am looking for a script which could read the file 2051105.html and change all the urls from realtive to the document, relative to the root to absolute address and out put a new file. In the new file, all the links, all the images, all the url referece will use the absolute url address

Such as "http://www.mysite.com/images/image1.jpg" instead of "/images/image1.jpg" or "../images/image1.jpg".

View Replies !
Use A Script That Has A Mail() Function And The Address Is To An Address Of The Same Domain As The Site
I just moved my php site to a new host. The previous host and the new one are both running the PHP 4.3.11. The sendmail path is the same.

If I use a script that has a mail() function and the address is to an address of the same domain as the site, it works ok. If it is to an outside address, it disappears. Though it returns it was a successful send.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved