14 Topics

Member Avatar for
Member Avatar for chozotheqhai

Currently doing C programming homework, I want to update the value in the file. But now I'm having a problem updating it. The problem I faced now was the codes below update the values but in the form of new lines. Instead of replace the original lines. What's wrong with …

Member Avatar for rubberman
0
221
Member Avatar for timetraveller1992

I am trying to write a multiline string into a text file but it does not appear as multi-line text. Here's my code $hostname = "localhost"; $username = "root"; $password = "sample"; $dbname = "code"; $code = <<< THECODE ; This is the main configuration file for your web app …

Member Avatar for Lsmjudoka
0
256
Member Avatar for andreiviziru

so i have the following code and is not working // Make user folder if (!is_dir('../user/'.$name)) { $user_folder = mkdir('../user/'.$name, 0777); $user_index = copy('../login/user.php', '../user/'.$name.'/index.php'); if ($handle_append = fopen('../user'.$name.'index.php', 'w')) { echo 'Succes opening the file'; } else { echo 'Error opening the file'; die(); } $string = 'text to …

Member Avatar for andreiviziru
0
210
Member Avatar for kirtan_thakkar

I want to add text string at the end of the text file. I used "a+" for it but it delete all the content and than enters text to it. So please help.

Member Avatar for msnadz
0
3K
Member Avatar for My_Specs_1

I am trying to create a code that will generate a webpage. Here is what I have so far. I am looking to just take data that is queried from our server and display it on a page. Their is a form that is populating the ID on the query …

Member Avatar for pixelsoul
0
178
Member Avatar for PriteshP23

Hello Everyone..!! I am beginner at PHP. I would like to have solution for "\n" in textfile php. $file = "testFile.txt"; $fh = fopen($file, 'a+') or die("can't open file"); $firstname = $_POST["prenom"]; $lastname = $_POST["nom"]; $mood = $_POST["humeur"]; $datestring = date("d/m/y "); $timestring = date("H.i.s"); $data = "$firstname ; $lastname …

Member Avatar for PriteshP23
0
202
Member Avatar for reco21

Im grabbing a page with below. $homepage = file_get_contents('http://www.example.com/'); echo $homepage; How do I write it to a file.txt and overwite in the event the file exists ? Thanks.

Member Avatar for reco21
0
1K
Member Avatar for cjohnweb

I have a project that, instead of using MySQL, I am supposed to use txt files to manage data. I have no say in this, I'm doing the project for a client. So I wrote a test file with functions for writing these data files, reading, etc. But it's not …

Member Avatar for cjohnweb
0
170
Member Avatar for cigoL..:)

Hi, I'm currently working on a school project ..i was wondering if someone can help, i'm creating a system which get's data from a database and creates a CSV file ..i Google a lot none of it helps, i want to get several rows from a table and write it …

Member Avatar for cigoL..:)
0
669
Member Avatar for glut

Hey, I have a question on fwrite. I know that fwrite can write things to your server, for instance, but when I put try to write C:\foo.txt, will this actually save it to my server, or to the clients computer? If not, then is there any way that I can …

Member Avatar for diafol
0
113
Member Avatar for aaloo

plz somebody help with this code . i m fed up now [CODE]<?php $x=5; echo $x; session_start(); $_SESSION['y']=$x; $string = '<?php session_start(); $x=$_SESSION['y']; echo $x;?> '; $fp = fopen("6.php", "w"); fwrite($fp, $string); fclose($fp); ?>[/CODE]

Member Avatar for aaloo
0
261
Member Avatar for aero31aero

Everytime I run this program and enter a new record, it gets terminated on these statements: [CODE] stud.pcent=((stud.mhin+stud.meng+stud.mmat+stud.msci+stud.msst)*100)/(mm.hin+mm.eng+mm.sst+mm.sci+mm.mat); fwrite(&stud,recsize,1,file); [/CODE] The whole program is this. It is only partially complete. [CODE] #include<conio.h> #include<iostream.h> #include<stdlib.h> #include<string.h> #include<stdio.h> #define UARROW 72 #define DARROW 80 #define ENTER 13 #define ESCAPE 27 int key; …

Member Avatar for aero31aero
0
183
Member Avatar for Museless

I am trying to find out how to replicate the output of fwrite("andbe", 4, 1, output); an encryption algorithm I am using writes its output as this, but I am sending data across a network, and need to be able to write this to a string to send. The algorithm …

Member Avatar for thines01
0
163
Member Avatar for MDGM

hi all, I have a php script that saves what the user types in into a text file using fwrite, and displays it on another page using file_get_contents. When putting in a pound sign (£), it saves the following to the text file: £ Any idea how I can stop …

Member Avatar for almostbob
0
235

The End.