Editing Info In A File
I am using a tab delimited file to provide information for a page to be displayed. I have used fgetcsv() to get information from the file, and it returns an array of information. I was wondering if there is a way I could change information in the file. For example lets say that $content[2] = "This" how could I change it so that, $content[2] = "That". I know how to change the variable to a different value, but I haven't figured out how to change the actual file.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
INI File Editing...
Does anybody know how to open up an ini file and edit one section? like find the section called [votes] and just replace the values underneath it, in that section alone? vote.ini [votes] a=7 b=2 c=55 d=0 find that section, replace the values with there new numbers, without having to deal with what sections come before and after this, in the ini file?
Php.ini File Editing
I need your knowledge, I want to add to my website php.ini file to change the settings of my mail() function so that my function is working fine except that the sender email is not my user but nobody@hostingprovider.com so Someone told me that its easily edited using php.ini but he dont know how, so I thought that you could help me in this situation. more details about my hosting: - Linux host - php 4.4.6 - apache
Editing An Xml File
I have an xml file that I use to store information in. I want to be able to add info to it without deleting whats in the file.
Editing One Line Of A File.
MySQL ahs been giving me tremendous problems ever since I tried to switch to version 5.0.20. I thought that I might make my own SQL program, out of PHP code. But if a user of it has a table with hundreds or more entrys, editing one line would take hours. If you can't get PHP to edit one line with a few functions, what about splitting a file into three parts and then merging them together after editing the middle part, like so: Code:
Editing A (config) File
I have a file with some configation in it... I am wondering how I correct single values in there. The most secure is to recreate the file, then rename it. But is there a way to correct a line in the text file? setting1=bla -setting1=blablabla Needless to say, there are things in there I'd like to keep at all times.
Editing A Line In A File
I have a php file, I need to open it, find the line that reads "$pass[0] = "fa03eb688ad8aa1db593d33dabd89bad";" and edit the value "fa03eb688ad8aa1db593d33dabd89bad". How can I do that, I have #Open the file $ourFileName = "access.php"; $fh = fopen($ourFileName, 'r+') or die("Can't open file"); fclose($fh);
Editing Text File With A PHP Form
I am trying to do something with PHP that i am sure is pretty easy. But not sure myself how to do it. I have a file that i want to pull into a simple HTML Form text field. From that field the person can just add in content or remove content.. Click "Update" .. And it will write the new content out.. Overwriting the old file if need be.
Editing And Overwritting Data In .txt File
I have a page whereby a text area is shown, and the initial value of it uses php to display the contents of the .txt file so that a user to update the paragraph of text shown and click submit to overwrite the .txt file with new information. The problem is i have no idea how to code it so that i can make the .txt file be over written. Code:
Posting Local File Info To A Php File!
I have a script that I run locally and im trying to get the info to post to a php file so that I can view it in a browser. What I need to know is how to set up the receiving php to post it to the .html . Now I thought it went along the line of creating the php file and putting it on the root of the server then running the local script against a that php info file and it would dump the info to a browser but it wont work like that (I'm guessing cause it's a local script and not on the web) I know this line is sending it to the .php in that directory but I don't know how to set up the receiving php I guess is my problem. gosub phpsend www.xxxxxxxxxxxxx.com /xxxxx/xxxxxxxxx.php %sendstring I guess what I need to know is whats the best way to post the received data to a browser after the script runs. Or to set up the receiving php file as for outputting it I can create the page I just need to know how to receive it .
Retrieve Certain Info From A File
I am wanting to bascally do an fread() on a file with a starting point and ending point. For eaxmple: I want to retrieve text in position 60 for 30 characters and place it in a string.
Writing Info To Text File
im writing some info to a text file im trying to make my script write people's ip and stuff PHP Code:
Directory Listing With File Info
I'd like to make a directory listing where instead of the entire filename I need it to show the filename minus the extention and get the value of charname= in the file itself. I've been told that I had to turn the directory listing into an array and then use "foreach (array as item)" to go through and open each file but I've tried several different approaches and I just can't get it to work. I've been able to make it list the directory in order using this script but after that I'm lost. <? $list = Array(); $handle = opendir('testdir/.'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $list[] = ($file); } } closedir($handle); sort ($list); reset ($list); while (list ($key, $val) = each ($list)) { echo "<a href=test.php?name=$val>$val</a><br>"; } ?> Here I'd like the $val after the name= to be just the filename without the extention (all files in the directory are txt files) and then the second $val which it shows in the list to be the value of the line charname= in the txt files themselves.
Comparing Data From A .txt File To DB Info.
I have a txt file that stores separate lines of information. Here is an example of one of the lines. Western Pleasure || height:>= 15, discipline:== 'western' That is just telling me the qualifications of the "Western Pleasure" show type, which is that the height has to be greater than 15 and the discipline has to be western. Now I am trying to take these qualification statements and compare them to values in the database, if both qualifications match up, I would like to add the word "western pleasure" to an array. Here is my current code:
PHP Reading Extra File Info...
I am an ameture digital photographer (along with a newbie developer) and I've an album of my pictures online. I've been building this album to be just how I want it and I've come to one last feature that I can't figure out. How do I read the extra file info from a .jpg image file (or any other file for that matter)? Each one of my pictures has 10 or 20 things included in the file like the Camera model, f-stop used, etc... and I want to be able to parse that out and show it on screen. Is that possible with PHP?
Retrieving Specific File Info...
Ive got a file which contains the following data: <option value="13">African Nations Cup XXV</option> <option value="16">asd</option> <option value="7">Champions League</option> <option value="1">English Premiership</option> What Id like to do is get the maximum value, so 16. Ive used file_get_contents to bring the file into a string, but now Im stuck getting that max value out. Unless theres a function for this, I believe the direction I would need to take is collect all value numbers using some string manipulation function, throw them all into an array, and just get the max value of the array. Is there an easier way?
Creating Info File With Variables
I'm trying to create a file with XML in it which contains user login info. In my script, a line is inserted that will be one type of user information, for example, <loginname>$username</loginname>. When the script runs, it actually inserts the characters $username. How do I make it so it enters in what $username equals, which is $_POST['username'] ? $userinfobody = '<?xml version="1.0"?> <loginname>"$username"</loginname> <loginpass>"$password"</loginpass> <contactemail>"$email"</contactemail> <regdate>"$todaysdate"</regdate>'; I am also getting a syntax error now at 1.0.
Grabbing Info From Text File.
I am trying to grab info from a text file, and with that information, I will grab info from a table and display it. I do not want to show --SELECT-- so thats why the IF statement is there. For some reason it will still show --SELECT-- but doesn't read it as such. If I try to say: Code:
Jpeg File Upload - Missing Info
While trying to upload an image via a Form, and using a Jpg format, I *sometimes* get an error: The file does not seem to be detected properly (returns 0 for filesize and no other info is availeable IE: name, type are blank.) This happens only with certain jpg files, is there a way to fix / circumvent this?
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.
Uploading Info From A Text File Into A MySQL Database
what would the PHP and SQL code be to say basically: make a new row and put this in the field, what comes after each comma goes in a new field, and each new line should be a new row. I have a huge text file that i don't have a way to upload directly into a MySQL database because my webhost isn't allowing it for some reason.
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed. Here is the situation... If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'. So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.
Editing A String To Add A Before A '
Is there a function that allows you to add a before a ' in a string. This is needed to store text in a mysql db and i was wondering if there is function which can do this to any ' which DO NOT already have one before them, this is so i can keep editing my text without all these building up.
Editing HTML/
I'm looking for a way to editing my site on the fly (unfortunately I don't have DB support). I've been messing around with file functions, and that part seems to work fine. My problem is that backslashes are being added when I post the form I use to edit the files, and if I understand it correctly, I can't just use stripslashes() since there are some backslashes I need to get through (like)Any solution to this?
Editing Rights
Is there any way to allow a PHP script editing rights to every file on its filesystem?
Editing .htaccess
Is there a way to edit a file (in this case .htaccess) in PHP to add a line of code? EX. What I want to do is add this line to .htaccess: DirectoryIndex main.php?id=5
Editing A Table
is it possible to print a table and then that the user can edit it? My site is for an institute so in a colum will appear all the names of the students and I want that they can give all the notes next to their names, so I was thinking in do it with a table but i dont know if it is possible to edit the table: Code:
Help On Editing PHPBB
I do manage a website and it includes a PHPBB forum, obviously placed at /forum (¿why to use a weirder path? :P). The thing is that my site is more than a forum, it has more content. I have menus almost everywhere, it's very navigable; but if you go into the forum, you can only get back to the other sections of the site using the back buton or removing everything starting from /forum in the address bar. Of course, this doesn't fit my site's philisophy, which is almost to put menus even inside the menus in every page, so you can go from everywhere to everywhere... I hope you cacth it. I've noticed that it shows the domain and title I put in the admin panel. Well, what I'd like to do is to make this text link to my homepage, placed at /index.php or simply /. The problem is that I'm completely lost when trying to do something in PHPBB's source files. I don't know which file should I edit, nor where should I add the code. These files are a code labirynth for me, and I need to edit them to fit my site's needs.
Looking For A PHP App For Editing Pages
Any ideas? Basically something that would allow me to upload/copy/delete/edit webfiles. It would probably use a WYSIWYG javascript editor. Not really looking for a CMS because they don't work with existing html files.
Form Editing
I am trying to call information from a MySQL database in for form of an editable form. I want the info to be called into a box that can by typed in and so far that works. What I want to do next is to be able to change what is in those boxes and click an update button which updates what was called from the database to what I typed in the box. The code I wrote is below and almost works. I'm not sure what the problem is. Code:
Drop Down Box Editing
I have 3 linked drop down boxes ( Eg: Country, State and City ) . I've set values for the drop down boxes initially and I would like to edit the values later. Is it possible to show/highlighte the set values ( the value I've put earlier ) while editing the drop down boxes using PHP or AJAX.
Editing A Table
i've checked my code like a thousand times and it seems to me there're no syntax errors in it, but I still don't manage to get the damn thing working. It's a script to update an event stored in a db, you can edit both the description as the date of the event. Code:
Editing A Row In A Table
I'm having trouble editing a row. The existing data echoed into the form ok but if I try to change anything and click submit, the error message at the end of the script is echoed. Code:
Editing Data
What i want to do is edit details that have been taken from mysql database and display them in a text box. I'm under standing what I’ve done so far which was to bring the job id code of the job that i want to edit from another page and i no the code to edit but what i can’t do is display the job data into a text box so it can be seen and edits can be made. All the books and website and forms I’ve read don’t show how to display the data to a text box or it’s so complicated that i don’t have a clue what’s going on? Code:
Editing System Passwords With Php
I need to create a php script that adds new users to my FreeBSD server. I've tried running the 'pw adduser' command through a script, but I can't pass a desired password to it. I've also tried using the pw command with a password encoded in md5, but I'm still pretty confused about how the encryption works.
Editing The Win32 Registry
Does anyone know if the equivalent of PERL's Win32::Registry module exists for PHP anywhere? If so, I'd be grateful for a push in the right direction.
Editing An Element Within An Array
I have a two-dimensional array that looks like this: array( array(0, 123), array(0, 234), array(0, 345), array(0, 456) ) I want to REMOVE any element that contains 234, and I want to INCREMENT the first value for any element that contains 345, to make it look like this: array( array(0, 123),...
Editing Files In A <textarea>
I've written this program to let me edit ASCII files on my server in a <textarea>. However, if the file that is being edited contains a textarea within it, then I get problems. what I want to do is read this file into the textarea but I want to convert all of the < and > characters to < and > 's. I figgered you'd do this through Regular Expressions: however these are poorly documented in the PHP book I have, though the Perl book I have tells me how to do this. Could someone tell me how to do this, IN PHP! Code:
Editing Mysql Db Using A Php Form
I am working on a Sig Request database. People submit their request using a form and it's posted into a databse and then displayed beneath the request form. This is working fine. I am having trouble however with my edit.php file. I want to be able to load a users information, which I have done using this code below. It displays in a form. I change 1 or 2 of the fields, such as the completed field and designer field and click update but it doesn't actually update the database. The page first lists all the requests. It lists their ID, Name and then it says "Edit this Request" which opens a page with their sig request details in. Here is my code below for the edit.php file. Code:
Editing Multiple Records....
Im trying to make it so that I can sort fo like edit all teh records in a table from one page, and im thinking have it like this: Field 1.........Field2......Field3.. Record1..................................Button to edit the info in this record Record2..................................Button to edit the info in this record Record3..................................Button to edit the info in this record Record4..................................Button to edit the info in this record
Editing HTML In A Form?
I want to build a very basic online text editor, to allow customers to modify their own sites' html content using a simple form with textarea element. I read the HTML file like so: <?PHP function EditText ($filepath) { if (!$file = file($filepath)) return false; foreach ($file as $line) { $value .= $line; // contains all text in file when done } $html = "<html><head><title>Editor</title></head> <body> <form method='post' action='processtext.php'> <textarea rows=ཤ' cols=ྌ' name='txt' value='$value'> <input type='submit'> </form> </body> </html>"; echo $html; return true; } EditText ('/sample/index.html'); ?> The problem comes when the parsed file containing html elements itself is echoed to the browser. In itself, PHP does what it's asked, but all browsers I tried choke on the contents of the TEXTAREA field. Best example may be: try parsing the file containing the script itself, it becomes a real mess. I tried htmlspecialchars, this did not fix it. I tried addslashes to only escape the quotes in the parsed file, also no success. I saw one example online where 'they' preg_replaced about every possible (x)html and php syntax element, resulting in an immensely large and slow script. Can't imagine that's the proper way forward. If at all possible I'd like to stay away from Javascript. Any idea if this is a realistic approach? Are there any useable scripts available? I searched google a lot, but I keep ending up at sites that offer html or php editors for local use, not in a browser.
Editing ID Field In Database.
I have come across a problem with some coding work that i am doing. My problem is the following: Presenters in the radio station, are shown in order of ID. What i want to be able to do, is edit the order in which they are shown, by editing the ID. My problem, is that when i process the form the script has no way of telling what the field names are, as they are not pre defined, because i have put the code in a while loop, to get all of the DJ's names & id's out. Code:
Editing And Updating Text
I'm trying to create a text editing and updating capability to help someone who wants to maintain content on a web page without having to know any HTML or use a web authoring tool and FTP'ng the contents. I've already created a screen whereby the person can create new content with a PHP program that inserts into a MySQL table. But, I'm having a little trouble in creating the edit/update functionality. I created an edit screen called "teach_edit.php". Based upon some search parameters on another HTML screen, it retrieves the appropriate text from the database. It seems to allow on screen editing. However, when I hit the Submit button, nothing happens. It's supposed to call another program called "teach_update.php". Here's the code for it. <HTML> <HEAD> <TITLE>Teaching Edit Program</TITLE> </HEAD> <BODY> <?php @ $db = mysql_connect('localhost', '<db name>', '<password>'); if (!$db) { echo "Error: Could not connect to database. Please try again later."; exit; } mysql_select_db("<db>"); $query = "select * from albert where ".$searchtype." like '%".$searchterm."%'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $title = $row['title']; $teaching = $row['teaching']; $teaching = wordwrap($teaching, 60, " ", 1); $teachnum = $row['teachnum']; } if ($result) {
Good PHP Editing Program
could someone suggest a good PHP editing program? I have been using GoLive - I'm sure there's something better out there.
Deletion And Editing Of Modules
i'm creating a miniature CMS. At the moment i'm working on the creation/deletion and editing of modules. I've got the creation working. But i'm struggling on the deletion and editing. This is what i was thinking: [Deletion] 1. (ID) Module 1 [Delete] (Link: modules.php?do=delete?name=Module%201&id=1) [Editing] 1. (ID) Module 1 [Edit] (Link: modules.php?do=edit?name=Module%201&id=1) How would i make it so the URL was that?
Editing MP3s Dynamically
I'm trying to work out if there's a way of using PHP to dynamically edit an MP3. Is this a bit too much for the old PHP to handle? I just want to cut it down to 10 seconds of audio if possible.
Editing Posted Bulletins
I have a section on my church website that pulls announcements stored in mySQL and displays them with PHP. I recently started working on a control panel so that other people could login and edit/create the announcements so as to keep it up to date and lighten my load. I use a while statement to display all of the bits of news but my question is how can I make an edit button specific to each row in the table on mysql? All I need to really be able to do is have an edit button spit out for each post that will set a session variable to that particular posts index number. I created the mysql table with this in mind and have index numbers to reference the chunks of data.
Editing A Users Profile
on my site the users can edit they're profile, basically a page with drop down boxes, they can change country etc, what i was wanting to do is when they goto the edit page to edit say they're country for example , the country they signed up with is pre-selected (if someone signed up with Scotland) Scotland is automatically shown first. Code:
|