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






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







Creating A File Using Function


I am trying to create a file using php file(). can some one help me? fopen() is no allowed on the server.


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Creating A Function
i'm trying to create a function called dochead to put a header at the top of a page. Here's how i tried to do it:

<?php

global $banner, $bannerw, $bannerh, $sitename;

$sitename = "MY SITE";
$banner = "http://www.domain.com/images/banner.jpg";
$bannerh = "120";
$bannerw = "760";

function dochead() {
echo "<div align='center'>";
echo "<img src='$banner' width='$bannerw' height='$bannerh' alt='$sitename'>";
echo "</div>";
}
?>

View Replies !   View Related
Creating Function
simplify this and turn it into a function. i then store functions in an .inc file and reference it as needed. Code:

//This will find current week
$today = date("YmdHis");
$week_array = array(20060819230300, 20060819231400, 20060924100000);
if ($today<$week_array[0])
{$week = "1";}
elseif ($today<$week_array[1])
{$week = "2";}
elseif ($today<$week_array[2])
{$week = "3";}
else {$week= "0";}

View Replies !   View Related
Creating A Class To Do A Function
I am creating a class to do a function that will be used a lot on my site. The problem i am having is i dont want to redefine a function that i already have defined in my functions.php page. is there a way that i can reference the funtion in side the class? do i just global the function? or is this even posible.

View Replies !   View Related
Creating A Search Function
I need to create a search function for a recruitment company website that allows the user to select from one drop down box whether the job is permanent, temporary or search all jobs and from that select the job category.

i have tried looking for tutorials on the web but cant find anything. Would anyone be able to point me in the right direction to find a tutorial to help me complete this?

it needs to work like the advanced search function on this webiste but only have the Job Type and Job Category search options: Code:

View Replies !   View Related
Creating A 'print_r'-like Function
I am working on a map of a rather large php project that I've been working on. I hope to create a map of the files of the project that would look like the output of the unix 'tree' command: Code:

View Replies !   View Related
Problem When Creating An Function
I am making an portal for my website, and, you got to have custom functions, right?
Well..i got a problem. This is my code:

define("GLOBAL_HTTP_ROOT", "http://localhost/lmsuportal/");

function goTo ($page) {
    $string = "<html><head><meta http-equiv="Refresh" content="0,"GLOBAL_HTTP_ROOT . "$page"></head></html>"; // This is line 43
    echo $string;
}

PHP Parse error: syntax error, unexpected T_STRING in C:wwwlmsuportalinitfilesglobal_init.php on line 43

I know what the error means, i just dont know why it´s triggered. The code is correct, right?

View Replies !   View Related
Creating Link To File Or Temp File For User Download
I am designing a document management system (DMS). The files are stored
in a directory on the webserver. The filenames for the documents are
stored in a MySQL database. The DMS will track revisions from the
initial version through the updates. We must have strict permissions
set so only authorized personnel can access some documents. All of the
documents when uploaded are given totally random names such as
"114723fb5422c6bd5ed18f6.doc". Is there a way, without the webserver
creating a new file name "document_specs_ver2.doc" to have the file
download named "document_specs_ver2.doc".

If I must physically create a new file, how do I know when the
webserver would be allowed to delete it? Notes: The files will be in
several different file formats, not just "doc".

View Replies !   View Related
Creating An Array Within A Generic Function
Say I have a function that is used to open different flat-file databases and read them into arrays. The databases have a different number of field indexes, with different names.

Is there a way of creating an array within a generic function, but with the field indexes as keys instead of just numbers?

View Replies !   View Related
Creating A Internal Website Search Function
How to create a website search function. whenever user search, its within a website and will show the page linking.

View Replies !   View Related
Creating A Function - Preg Match Pattern
so i made it so it strips out all html and php code using strip_tags and have htmlspecialchars so it will print html. also i have a function in place the checks and strips the comment variable of all XSS patterns in place. however im still getting posts like how would i make it so you cannot even copy and paste links? even without doing it in html? i know you would have to do a preg match pattern but i couldnt find any patterns on google.

View Replies !   View Related
Creating Pdf File
Is it possible to create a pdf file from a HTML form. i want to create a pDF file from HTML form which looks like the scanned copy of HTML form. I hope there must be somebod< who can answer this question.

View Replies !   View Related
Help In Creating XML File From DB
Hi friends

i need to get the details from two tables for creating one XML file.. for that, first i started by defining a DOMXML object

$doc = domxml_new_doc(&#391;.0');

and i have one outertable query as

$outer_table = 'main_category'
$query = "SELECT * FROM $outer_table";
$resouter = mysql_query($query, $mysql_connect);

and when its first row is read
its creating elements by

$child = $doc->create_element($fieldname);
$child = $outer->append_child($child);
$value = $doc->create_text_node($fieldvalue);
$value = $child->append_child($value);

and

i need to get some details from second table
with its subcategid=maincategid

to do this
i need to get that particular field that alrady appended to the xml How i can..... i tried get_elements_by_id() but it returns only those elements that comes under it.]

View Replies !   View Related
Creating Rtf File With Php
I would like to creat an rtf document with a php script - has anyone seen it
done?

View Replies !   View Related
Creating A PDF File
I'm not a programmer but I may need to have an application developed which can create (or modify) a PDF File.

There appear to be libraries of code to assist with this.

Is it possible to say which is simpler

- to convert from a WORD document
or
- from an HTML file

View Replies !   View Related
Creating A Php.ini File
OS: Linux, php: v4.4.0, scripts are ran as CGI executables

Greetings, I have been trying to set up a cms for a group and I'm pretty new at all of this. here's my problem...

When I run a security mod on the site I am getting the following security errors:
'register_globals' : on Not secure
'allow_url_fopen' : on Not secure
'session.use_trans_sid' : on Not secure

After googling, emailing the host and trial and error I have discovered that I need to create a php.ini file. There is currently no .htaccess or php.ini file in the site.

My latest attempt at the code still gets the errors: ....

View Replies !   View Related
Creating A Csv File.
I am working on a site and have given my client an option to export the product list, import new products and update the existing products. Things are working well. I am using the escape function to escape the single and double quotes and the import and export is work well. but the other day i found a problem and can't work out how to work around it,

Basically the database and the books in it have been uploaded before i started and a lot of the quotes and single quotes are still in the database and ' and " and not ' or ". changeing those are not a problem. The problem come when they have ‘ ’ “ ” stored. I ones in the database i have seen i have converted to &lsquo; &rsquo; &ldquo; &rdquo; but there are others.

So basically i was wondering if anyone else create csv file what rules do you use to fix all the problems. Another point is when i save HTML into the database (the HTML is created using FCKEditor) itt puts line breaks at the end ot the lines. When i export it to a csv file it still have the line breaks in. I have tried to remove the but thats doesn't seem to help.

View Replies !   View Related
Creating A .txt File
Creating a ".txt" file (or any text file for that matter) can be done simply with PHP. Code:

View Replies !   View Related
Creating Csv File
I would like to export data to excel. I understand that I would need to create a csv file to do so. But I have no idea of how to go about creating the file. I've read up some tutorials but still don't know how to create the csv file for my php codes. Code:

View Replies !   View Related
Creating XML File
how to create this XML file? I have these two queries that give me the values for my two variables, $completed and $not_completed. Code:

View Replies !   View Related
Creating An Image File With Only PHP
Is it possible to create an image file from a string using only functions
from core PHP (in other words, without 3rd party libraries/applications)?

I'm interested in any image file that is displayable without plugins or
helper applications, like jpg, png, gif.

View Replies !   View Related
Creating A Zip/rar File When Uploading
when a user uploads a file to my site i was first of all wanting to put the file into a zip/rar file for easier downloading i havce this so far:

// create a zip file with file inside...
$createZip = new createZip;
$fileContents = file_get_contents(uploads/$filename);
$createZip -> addFile($fileContents, $filename);
$fileName = "$filename.zip";

View Replies !   View Related
Creating A File On My Server...
I need to find out what I would to to create a file on my server from a personal form. Like lets say the form is like this:

IdNumber: 7
Username: Drags111
Password: Password

I would want the name of the file to be the idnumber (7 in this case), and the contents to be like:

Username: Drags111
Password: Password
Also is it possible to password protect the file when I make it?

View Replies !   View Related
Creating An Installation File
I have created my application and am now working on creating an installation file. Is there any framework or php application that helps me generate this file?? also is there any article i can read to help start me off on this??

View Replies !   View Related
Creating An Email File
I am trying to create a file on our server with the contents of an email that is sent to users automatically. However, I can't seem to get the syntax right because it keeps dying (displaying message "can't open file"). What is wrong here? PHP Code:

$ourFileName1 = './emails/' . "{$_POST['auth_email']}" . &#55617;&#56880;.txt'
            $ourFileHandle1 = fopen($ourFileName1, 'w') or die("can't open file");
            fwrite($ourFileHandle1, $auth_email_message);

View Replies !   View Related
Creating An HTML File
I want to create an HTML file with PHP. I have the string with the HTML in it. What functions would I use?

View Replies !   View Related
Fopen() Not Creating File
I am attempting to write an online HTML editor for my website, and the first step is trying to make sure that the user has an index.html file in their folder, and if it doesn't create it and put in the basic text that the file should contain. For some reason the code won't make the file, and thus it is unable to read it into my textarea box. I have my error reporting turned all the way on. I have tried using the following methods of opening the file: w, w+, x, x+, a, a+. None of which will create the file for me.......

View Replies !   View Related
Creating A Pdf File On The Fly With 15 Lines Of Php
I have run across a php script that has about 15 lines of code. With a little re-work I have been able to send form data direct to a template I have created. The problem is, I also have images selected in the form, but the images don't show up... just the url of the image.

View Replies !   View Related
Creating And Modyfiing A Php File
I'm trying to edit a php file and use fwrite to add a line to the top of the page. But in my attemps it's been adding it to the bottem. Trying to add 'new stuff' to the top of the page of theshow.txt. PHP Code:

<?
$myFile = "theshow.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "New Stuff 1";
fwrite($fh, $stringData);
$stringData = "New Stuff 2";
fwrite($fh, $stringData);
fclose($fh);
?>

View Replies !   View Related
Creating Temporary Jpg File !
I'm working on a page which needs to handle base64-encoded jpg files. I need to decode them and be able to use it further on on the for viewing. I do not want a jpg-onky page with the result, but need to place it in a table, etc.

Problem is, with my current script (see below), the encoded file gets copied, renamed and is usable for viewing, but next this image just resides on the server, while it should be deleted after the image is loaded onto the client's screen. I tried to delete the copied file after the lines of code to display the image, but then the browser says no image is found.... Code:

View Replies !   View Related
Mysql And Creating An XML File
How can I best create an XML file with PHP and Mysql (i want to feed the XML file with content from the Mysql database)?

View Replies !   View Related
Creating New Text File
I know how to open a .txt file, read it, write in it, and close it. However, is there a way to create a new .txt file???

View Replies !   View Related
Creating A Text File
I am trying to create a text file which contains all the data from a mysql database. I also need to include some information at the head of the text file. I would like to use a php page to do this where the header data would be sent from a form and the data taken from the database to create 1 text file. My first issue is how to retreive the data from the database using a php script.

View Replies !   View Related
Creating An XML File From A PHP Search Engine
I've written a search algorithm that will be used on a fairly large (350 - 400 pages) site. I have decided to make the script output an xml file to which I will apply an xsl style sheet to format and display the results in html.

My question is what is the best way to create the xml file using php? Are there any useful functions available specifically for this type of thing, I have searched the forums but found nothing of any use. The way I'm thinking is to create the xml file at the beginning of the search script, loop through searching the pages and building an xml fragment for each result, after the loop has exited the script will add the closing xml tag.

I know that I can make the script work how I just described it but I would like to know if anyone has written anything like this before and whether there are any shortcuts or tips that anyone knows of.

View Replies !   View Related
Creating VCalendar File, Fails In IE!
I have a script producing a .vcs file for Events taking places. If you click the link in FF, the download boax appears, click Open with "Microsoft Office Outlook" and the Event page is loaded with all data.

If you try the same in IE, when you click the "Open" button, Outlook sounds with a Error: "The operation failed. An object could not be found." If you save the file to disk and click open, via IE it loads fine. Just not on the fly. This happens on any machine with IE.

I have just tried to access a static created vcs file off the server, via IE and it works fine, so It would appear to be a problem with IE trying to access the dynamic file, as if the temp vcs file is not being created when you click "open". How can I solve this, if its a IE problem?

View Replies !   View Related
Creating A Config File Through PHP Form
I have a php script that creates a config.php file (with mysql database name, password, etc. in it) from user input into a form.

It is creating the config.php file with the permissions of 666. Will this be a big security problem? Does giving permissions with global write access make it more possible for others to get access to the username password information? Or does it just make it more possible for them to write over or delete the file?

I noticed that if I modify the script to chmod to 644, then it is no longer possible for me to change the file permissions or even delete the file through an FTP client like FileZilla because PHP has the file ownership which is different from the FTP owner.

Does anyone know the security implications of the config file having permissions set at 666?

View Replies !   View Related
Creating A Variable From A Text File
I have a text file which is basically an array declaration and I would
like to assign this to a array variable.

It reads like this (extract)

myProfile = {
["Blackhand"] = {
["Fingali"] = {
["Inventory"] = {
["Bag4"] = {
["Contents"] = {
[1] = {
["Quantity"] = 1,
["Name"] = "Hearthstone",
["Color"] = "ffffffff",
["Tooltip"] = {
[1] = "Hearthstone",
[2] = "Soulbound",
[3] = "Unique",
[4] = "Use: Returns you to The Crossroads. Speak to an
Innkeeper in a different place to change your home location.",
},
["Item"] = "6948:0:0:0",
["Texture"] = "InterfaceIconsINV_Misc_Rune_01",
},
[2] = {
["Quantity"] = 1,
["Name"] = "Skinning Knife",
["Color"] = "ffffffff",
["Tooltip"] = {
[1] = "Skinning Knife",
[2] = "One-Hand",
[3] = "2 - 5 Damage",
[4] = "(2.2 damage per second)",
},
["Item"] = "7005:0:0:0",
["Texture"] = "InterfaceIconsINV_Weapon_ShortBlade_01",
},
[3] = {
["Quantity"] = 7,
["Name"] = "Cactus Apple Surprise",
["Color"] = "ffffffff",
["Tooltip"] = {
[1] = "Cactus Apple Surprise",
[2] = "Use: Restores 61 health over 18 sec. Must remain seated
while eating. If you spend at least 10 seconds eating you will become
well fed and gain 2 Stamina and Spirit for 15 min.",
},
["Item"] = "11584:0:0:1388764288",
["Texture"] = "InterfaceIconsINV_Misc_Food_19",
.....


I tried this

$lua = urldecode($lua);
$thefile = implode("", file($lua));
$arr = ${$thefile};

View Replies !   View Related
Need Help Creating A File Search Online
I need to create a search that will search partial files names of
images and
display the images. Basically, I have a folder on the internet that
has
security camera images dumped into it with a file name like this:

MDcameraname20050109104846001N38B.jpg
MDcameranameYYYYMMDDHHMMSS001N38B

So what I would like to create is a search that will allow a user to
input
the year, month, day, and hour, and have the website display the images
from
that hour.

View Replies !   View Related
Creating A File, Uploading, And Permissions
I'm using php4 and i want to check for a file, if it doesn't exist it
should be created. My problem is i have to create it with specific
permissions specifically 666 so that the script can then write to it. I
don't have ftp access. I'm also looking for any tutorials, recent ones,
using php4 for creating file upload areas, i'm trying to make one of those
as well.

View Replies !   View Related
Creating File In Client Side PC
Is it possible to create a file in client's PC using fopen() method? If not, how can create a file in user's PC?

View Replies !   View Related
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.

View Replies !   View Related
Creating A File Tracking Application
I am looking for an excel template or application that will help my track 800 or 900 books. I will like to keep track of metadata information about the books (author, title, ISBN..etc), Status(pull down menu), dates(time stamps), dates file updated, and who updating the spreadsheet. Also, I would like to have some sort of check-in system that will make sure it will lock or at least alerts the user that some other user is updating the files at the same time.

View Replies !   View Related
Creating For() Loop For Each File In A Folder
Is there a way to get a list of files in a certain folder and run a loop to process each file? I'd like to create a page which displays each thumbnail image in a folder.

I'd also like to add the location of the image to a database, if it's not there already, in order to link each thumbnail to the full image. Is this possible? What command(s) could I use?

View Replies !   View Related
Creating Text File With Page Breaks
If is a newline and is a carraige return, what special character is used for a page break?

View Replies !   View Related
Creating/writing To Text File And CHMOD
When I try to create a file with fopen(xxx.txt, w) I only receive an error message. Also when trying to append text to an existing file. I then chmoded the existing file to rw-rw-rw and it works now, but is this the right permission ? And how can I create a new file ?

View Replies !   View Related
Passing Variables To An Image Creating Php File
I have been working with the gd functions in PHP to render an image. I was able to solve the (apparently) usual header problems and such like via searching through this page and help documentation, such that I am now able to produce an image by doing the following : Code:

View Replies !   View Related
Remove File Extensions Before Creating Links
i have some working code here that creats a list of links in the noted directory, but i would like it to remove file extenions. they are all word docs.

also is there a way to force it to open in the browser? all computers will be running latest IE6 and maybe IE 7 in the future. Code:

View Replies !   View Related
Creating A File Storage System For A Web Application
I am creating a file storage system for a web application. What I am doing is storing the name, size, and type in a database, and storing the data itself in the root directory tree.

I do not keep the file extensions on these files in the tree, they are given a random 12-letter name (2l3j4234j343). However, after I collect the data from the form and write it, it is not an exact copy. Code:

View Replies !   View Related
Opening/creating A File For Write With Fopen
I am having a problem opening/creating a file for write, using

$connectfile = "connect".$db_name;
$connectfile .= ".php";
if (!$fp = fopen($connectfile, 'w')) {
echo "Cannot open file ($connectfile)";
exit;
}

View Replies !   View Related
Creating A File And Putting A Line Of Code
I'm trying to put lines of codes inside a created php page Code:

View Replies !   View Related
Creating And Sending A .htaccess File To A Server
ok so im currently using the code: RewriteEngine on

RewriteRule ^example/example/$ index.php?example=example
RewriteRule ^example/example/$ index.php?example=example
RewriteRule ^example/example/$ index.php?example=example
RewriteRule ^example/example/$ index.php?example=example

Now this all works fine but what i would like to do is automaticly update this along with my database (through my cms). I know its possible to edit a pages contents in php and im pretty sure its possible to create a new page.

My question here is how can i do this using php? I can handle the database side of this. (generating the RewriteRules from querys) but if anyone can help me with creating the new page and dropping it onto my server then i would be very greatful.

View Replies !   View Related
How To Pass The Entire Variable Without Creating A Temporary File
When attempting to create a nice confirmation screen after a form is submitted, I used <input type=hidden name=variable value=$variable> type fields to pass the variables on to the next php script that processes, adds to mysql and writes a file.. Anyways, the hidden field only passes the first word, which I understand, but how to pass the entire variable without creating a temporary file that holds each variable.

View Replies !   View Related
Insert Comment In Excel File Creating Dynamically Through Php?
Is any way to insert comments in excel file when we generating excel file thouough php.

View Replies !   View Related

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