Archive for the ‘PHP Questions and Answers’ category

How Can I Replace A Specific Line In Text File Using Php?

July 13th, 2010

how do i replace a particular line in a text file with an array string?
example:
text file contains the following
red,brown,green,black
black,green,red,brown
green,black,brown,red
so if i have $array = “purple,grey,pink,cyan”;
how can i use fwrite to replace line 2 in text file which is green,black,brown,red with $array
i want to replace the whole line 2 with the arrray string.

Is There A Php Function That Returns The Script’s File Name? If So What Is Its Effect In Included Php Scripts?

July 13th, 2010

As in, if you have a file ‘main.php’ which includes ‘included.php’, and this function was called in included.php, what would be returned?

Is It Good To Use .php For All Pages In A Site Including The Homepage?

March 1st, 2010

If instead of using .html extension with javascript and use .php with php coding is it better and appreciated? Can php be disabled?

How Can I Add A Link With Php Only When A User Is Signed In?

February 28th, 2010

I’m using php for my use logins and my set up is..user types in information, it is saved in a mysql table, when they login it verifies the info. How can i make it so that i take away the login link with a logout link and add another link so the user can view their profile?

swarovski crystals

Can Someone Help Me Out With Modifying Data In An Oracle Database Using Php?

February 28th, 2010

I need to modify existing data in a database using PHP. So far it works but only if i modify the data such that it has less characters than it originally did ie i can change ‘trial’ to ‘try’ but not ‘try’ to ‘trial’…any idea why this might happen?

Where Can I Obtain A Php Script That Will Post Articles To Hundreds Of Wordpress Blogs Automatically.?

February 28th, 2010

The script will be a membership site that will allow people to register and submit their articles to bunches of Wordpress blogs.

How To Do I Run A Php File On My Localhost On A Mac?

February 27th, 2010

how to do i run a php file on my localhost on a mac , im cant be bothered uploading to my hosting space, but was told that i would be able to run it via dreamweaver but not sure how to do this. any help would be great

How Hard Is It To Install Php On My Laptop?

February 27th, 2010

I want to test my PHP code before putting it up on the server. It’s a shared hosting account so I don’t want to adversely affect the other webs on it.
I have Vista on my laptop and I just want to try some code locally before I upload.
I could set up a dedicated L.A.M.P. machine, but I wanted to stay portable.
Any suggestions?

What Software Can I Use To Make Professional Websites Without Knowing Html, Php, Or Any Other Language?

February 27th, 2010

I’m a skillful animator and graphic designer, but lets face it, not very good at coding. I was wondering if there was any really good, professional software, where i can just upload patterns, and images, and GIFs, and designs, drag them around, assign them certain properties, and then magically come out with an HTML code. I need a lot of creative freedom!
Any software like this?

How To Use Session In Php To Separate Members From Non-members?

February 27th, 2010

the idea is to use session to separate it
so if non-members loaded the page, it will display sth different.
like comment..
if non-member see it, it will display the login form
if member see it, it will display the comment form to input.