Jump to content

Recommended Posts

Here is what I need to do and wonder if someone could tell me how I could go about doing it.

 

I have an HTML file that contains variables read by a flash template.

 

The variable string starts and ends with an &.

example: &home_text1=SOME TEXT HERE&

 

What I would like to do is for the code to read through this file locate the first "&" and skip to the = sign then read and post the text in a text box for editing.

 

People have suggested using a MySQL db but I am unaware of how to connect a db to this flash template. I have tried lots of different methods to read the file but don't know how I could filter through the file and do what I need it to.

 

I have the base script to read and edit the file in one textarea but its to confusing to hand over to a customer. If someone could help me out here that would be great.

Here is an example of the one I use for flash sites, so customers can update the regular stuff as needed like news.

 

A little form -

 

<form action="news.php" method="POST">
<input type="hidden" name="action" value="login">
<p align="center">UPDATE NEWS:<br />
<textarea rows="30" name="textbox" cols="80">
<?php include("news.txt") ?>
</textarea><br />
<input type="submit" value=" Save Changes " class="button">
</p></form>

 

And how I process it -

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
    <script language="php">
$textbox = stripslashes($textbox);
$search = array ('@[\r]+@');
$replace = array ('');
$textbox = preg_replace($search, $replace, $textbox);
$txt = '';
$output = $textbox;
$fp = fopen('news.txt','w'); 
$txt = "$output";
fputs($fp, $txt);
fclose($fp);
</script>
<style type="text/css">
<!--
.style1 {
font-size: 24px;
color: #000066;
}
.style2 {font-size: 24px; color: #000066; font-weight: bold; }
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<p align="center" class="style1"> </p>
<p align="center" class="style2">UPDATES COMPLETE, THANK YOU.</p>
<p align="center" class="style2"><input name="Submit" type="submit" ONCLICK="window.location.href='updates.php'" value=" Back To Updates Page " />
</p>
</body>
</html>

 

Hope that helps, if you need anymore info let me know. Heading to bed, can't see straight.

You have something very similar to what I need and I plan to use php to write to the file but the thing is this file has all the text for each of the pages on the flash template. I need a way to break up the file. If there is a way for php to look for comments and break up each of the sections of the file into different text areas that would work as well.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.