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




Create Text Effects


I want to create text effects using PHP and GD. Using arc text style or what ever. For example I want the following result. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Register_globals, Effects On $_GET And $_SESSION
I read php manual many times but I can't figure out register_globals
works. I m using Php 4.3.2 and register_globals on. It seems to have
different effects on $_GET and $_SESSION. First with $_GET :

<? echo $var."";
echo $_GET['var']."";
$var="gna";
echo $var."";
echo $_GET['var']."";
$_GET['var']="gnou";
echo $var."";
echo $_GET['var']."";
?>

This page is called by <a href="work3.php?var=gni">work3</a>.
And produce this output :
gni
gni
gna
gni
gna
gnou
What I understand is that before reading the script, a global variable
is created with the same name and value as _GET['var'] but these are
eventually two distinct variables.

Then with $_SESSION :
<? session_start();
$_SESSION['test3'] = 'this is a test3'
?>
<a href="work5.php">work5</a>

and in work5.php
<? session_start();
echo $test3."";
echo $_SESSION['test3']."";
$test3="gna";
echo $test3."..

Adding Font Effects To A Very Small Php Bit
So I have this small PHP bit and I want a red and bold font on the line that says "This post has been deleted by:" but not sure how to get it in there.  Here's the bit:

$post = 'This post has been deleted by:'. $usr;
$ta = array ('post' => $post,);
$db_string = $this->ipsclass->DB->compile_db_update_string( $ta );
$this->ipsclass->DB->simple_exec_query( array( 'update' => 'posts', 'set' => $db_string, 'where' => 'pid'.$pid ) );

Create Different Text Files
I need to create a different text file every time a user registers. Currently every time a user registers there details are sent to "users.txt". So all user details are in the same text file. I would idealy like each text file to be named after the username registered. Here is the code currently being used:

$username = $_POST['username'];
$password = $_POST['password'];
$data = "$username, $password /n";

$fh = fopen("users.txt", "a");
fwrite=($fh,"$data");
fclose=($fh);

Create A Table Regarding A Text File
I have this .txt file :

Roger|tow25$rank259
Isabelle|tow36$rank24
Pascal|tow12$rank29
Sergeï|tow45$rank5
Michel|tow1245$rank45478
Frédéric|tow1$rank125425

And this programm php3
<?php
$fichier = "classeur.txt";
if($fp = fopen($fichier,"r")){
$ligne=1;
echo "<table border=1 bordercolor="#00CCFF" width=500>
";
echo "<tr align=center><td colspan=3>TITRE</td>";
while (!feof($fp)) {
list( $name, $tampon ) = explode( "|tow", $fp );
list( $tow, $obj ) = explode ( "$rank", $tampon );
echo " <tr>";
echo "<td
align=center><b>Nom".$name."</b></td><td>Tow".$tow."</td><td>Obj".$obj."</td[color=blue]
>";[/color]
echo "</tr>
";
$ligne++;
echo "</table>
";
echo "$cell";
fclose($fp);
}else{
echo "Error : open impossible ".$fichier;
exit();
}
?>

I would like to past each value of the lines in the tex file, in 3 variables
$nom; $tow; $obj
and create a table with 3 column ( column 1 the name, in 2 the tow, and in 3
the obj)

Create A Delimited Text Array
How can I create a delimited text file to work with this script. I would like to put this first part in a text file and load it into an array so the php script can parse it. Code:

Help? How To Create Next Buttons When Using A Flat Text Database
Ok, I know the code below does not work but I am wondering about the logic...

1 How do I just print 10 rows.
2 How do I get the buttons.

You get the Idea. Anyway, I would like to know if anyone has done this with text files. I always see mysql as examples but nothing using a flat text database.

<?
$maxResults = 10;
$datafile = "sometextfile.txt";

$rows = @file($datafile);
for($size=0;$size<count($rows);$size++) {
$rows[$size] = chop($rows[$size]);
$coll = split("|",$rows[$size]);


// print something

}
if ($size > 0) {
$currPage = $size / $maxResults;
if ($currPage > 1)
print("<A HREF="test.php" >['prev']</A>");
for ($i = 0; $i < $size / $maxResults; $i++) {
if ($currPage == $i + 1)
printf("<A HREF="test.php"> </A> ",$i + 1);
else
printf("<A HREF="test.php"> </A> ",$i + 1);
}
if ($currPage < size / $maxResults)
print("<A HREF="test.php">['next']</A>);
}
?>

I Want To Create Web Page Acting As Text Editor?
What I am trying to do is to create a tutorial for my beginning students for JavaScript and PHP, using a very simple online editor like the one @ w3schools, So the left window will be the text file code, such as:

<html>
<body>
<script>document.write("This is a test.");</script>
</body>
</html>...

Need To Create Drop Down Box With Data Pulled From Text File
Trying to make a drop down box like this example:

Dog
Cat
Bird

But sometimes I will need to update it...and add/remove names from the list. I want to do it fast and easy and I don't want to use a MySQL Database. I'd rather use a text file...can that be done? I would keep the info in a text file and then push it to a drop down box via php and html.

Quickly Adding Text To A Mysql Text Field That Is NOT Empty
Is there a way to insert text into a mysql text field that already has
text into it; without having first to extract the existing data and
append the new text to that string variable and then insert the new
string.

Basically i'm looking for a way to do it with a single query not 2 (one
being a select to gather existing data).

Gaining Access To How MySql Parses Text For Full Text
I want to gain access to the function or process MySql uses to parse words and phrases for Full Text searching. Here is an example.

If the user inputs...

Milan in history

MySql will search for milan, history, and milan history. Is there a way to extract just the combination of terms MySql uses to search the db without the stop words? Stop words are automatically eliminated from the search request unless the user encloses a phrase in quotes.

What I am trying to do is develop a script to highlight found search terms and phrases. I can explode a phrase into single words but if I do that the stop words would be included in the array. If there is some way of getting into the parsed words or phrases MySql Full Text actually uses to search, I can use each of those combinations as a keyword in my highlighting script.

This request is about searching for the code or any code related to the questions involved.

Text Area Not Accepting Large Amounts Of Text
I have a form where teachers enter homework assignments and they are then stored in a MYSQL database and retrieved elsewhere.

I have been using "get" with the form. The code is simple:

<textarea name="array[assignment]" cols="60" rows="10" id="array[assignment]"></textarea>

It does allow post of 100 words, etc. Stuff that teachers normally submit.

What's happening is that it won't allow very large posts (over 300 words maybe? ) Not sure what the cut off is. When you press submit it won't go, or there is an error where it won't submit.

Is there a limit for text fields? Since the fields scroll, I didn't think that having only 60 rows was any type of real limit, I though you could put in as much as needed. But then all of it ends up in the address bar, so there must be a limit of some sort.

Imagettftext() Gives Grainy Text When Writing Aliased Text
I'm using a bundled version of GD: 2.0.23 compatible. When using the
function imagettftext() with a negative color to get a aliased text,
the text gets grainy. What could be wrong? I've tried several ttf
fonts, with the same result.

Read And Display Japanese Text From Text File
I posted a question regarding reading japanese
text from a text file.

Well, since I solved the problem, I thought I'd post my solution for
the benefit of other people with the same problem.

The plan was to make a script to read and display japanese text. I
will use it for making a japanese proverb script and for a japanese
language study script.

Method :

I wrote a simple kanji text file (saved with UTF-8 encoding)
I wrote a simple PHP script to display the file contents (saved with
UTF-8
encoding)
I specified the content-type header for the HTML page :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

*** All files have the same encoding. ***

UTF-8 supports japanese characters.

and it works!

this is my PHP (and HTML) script :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHP : Japanese Text File Read : Exercise 1</title>
</head>
<body>

<?php

$filename="japanese.txt";
//open file
$fp = fopen($filename,'r');

//loop through each line in the file
while($line=fgets($fp))
{
//output current text file line
print $line."<br>";
}
//close file handle
fclose($fp);

?>

</body>
</html>

I know it's a very simple script, for testing purposes only. It
displays the contents of the japanese text file line by line.

The key was to save all files in the same encoding (I used UTF-8) and
to specify the encoding / charset in the HTML header (<meta
http-equiv="Content-Type" content="text/html; charset=utf-8">)

Append Text At End Of Existing Text On Same Line
I'm working on a part of my web site that uploads images, then writes the name of the image to a text file. The upload part works fine. The part that writes the name of the image to the text file works fine.

What I'm trying to do is, after all the files have been uploaded and all of the image names have been written to the WriteTo.txt file, append a written description of the picture at the end of the picture name. In other words, after a user uploads their pictures to the server I want to direct them to a page where they can label each of the pictures using a form. PHP Code:

Adding Text To Text Window With A Button
I have made an admin section of a site, What i want to do i have buttons under that have "BOLD" "center" and when clicked it adds <b></b> tags to the text area etc etc..

if the text area was called "message"

how would i going about coding the images / buttons to add the code?

PHP - Using Mail() And Unicode Text - Text Gets Disturbed
I have the following problem. On a website there's a (simple) feedback
form. This is used also by Polish visitors who (of course) type Polish
text using special characters.

However, when I receive the text in my mailbox, all special characters
have been turned into mess......

For example: "wspólprace" is turned into "współprace".

It seems PHP is handling the Unicode-8 strings quite well (when I
'echo' the strings on the site, I see the text correctly), until the
point that it is send by using mail().

Is this a server configuration issue? Or something else?

How can I get my text to remain in Unicode?

I have this problem both on my testserver (Apache 1.3.28, PHP 4.3.2 on
Windows XP) as on my providers server (Apache under Linux).

Remove Text Header In Text File
I have been having trouble removeing two header lines at the top of my txt file. You will see in my code the different things I have tried but with no luck. Below I posted my script and data. I am doing a few other things in my script as you will notice but this is the only thing I am having troble with. Code:

Parsing Text - Capture Text Between Two Tags
I want to have text in files, such as

{body}
{/body}

and then be able to open that file and grab all of the data inbetween those tags. I could open the file and go through it until I see the {body} tag and then store data until I reach {/body} but that is a bad way to do it.

Text Returned From DB Gets Cutoff When Placed In A Text Field
I have a string that contains an apostrophe or a quotation mark, stored in a DB. I can retrieve the data, and display it properly (for editing) in a textarea, but when I try to put the string in a text field, it get's cut off right before the questionable character.

For example:
$string_in_database = "John's car."

 -displays correctly here <textarea><?php print $string_in_database ?></textarea> and displays this - John's car.

 -gets cutoff here <input type='text' value=''<?php print $string_in_database ?>' /> and displays this -  John

I've tried adding slashes and stripping slashes and I just can't figure out what I need to do.

Keep Text In Text Boxes After Form Is Rewritten
I'm trying to make a form that does the following:

(1) the user answers a question by typing in a text box
(2) a response is then written below the form, saying whether the answer is right or wrong and, perhaps making a comment of some kind
(3) the user's answer remains visible in the original text box

I've managed to write some code that does the first two things, but despite many attempts and much searching for code examples, I've failed to find a way of getting the answer to reappear in the text box when the page is rewritten.

This is my code:

Replacing Text For Use In A Text Area...
I have a PHP page that allows a user to preview an email and then send it
if(s)he is happy with it.

Otherwise, they can click on an edit button and edit the text of the
message. The text is then shown in a textarea element.

While in situation A (the preview), a bit of formatting is useful (e.g
<BR>), all of this formatting is a nuisance in the textarea.

Basically, I would like to do the following:
a. replace <BR> with a line break for the textarea
b. get rid of double spaces and tabs before the text is loaded in the
textarea
c. put the <BR>s back in when the user is finished with editing the message.

Is there a way to do this?

Create Rss Xml
I'm currently working on creating the xml feed since I had data ready
in my database after web data extraction. However, it has errors for
this line:

<xml version="1.0" encoding="ISO-8859-1">

I was unable to solve this.

<html>
<head>
<title>MMU RSS FEED</title>
</head>
<body>

header("Content-type: application/xml");

<xml version="1.0" encoding="ISO-8859-1">

<rss version ="2.0">

<channel>
<title>MMU RSS FEED Today: <?php echo date("D, d-M-Y H:i:s")?></
title>
<link>http://bulletin.mmu.edu.my/</link>
<description>MMU RSS FEED</description>
<ttl>60<ttl>

<?php

//connect to database
$db = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("bulletin", $db) or die(mysql_error());

$day = date("Y-n-j");

//select queries
$sql = "SELECT * FROM `bul_data` WHERE `DATE` LIKE '{$day}%' ORDER by
`DEPARTMENT`";
echo "sql=".$sql;

$res = mysql_query($sql) or die(mysql_error());

if(mysql_num_rows($res)>0)
{

while($row=mysql_fetch_assoc($res))
{
$date = $row['DATE'];
$title = $row['TITLE'];
$department = $row['DEPARTMENT'];
$link = $row['LINK'];

//output to browser

echo "<item>";
echo "<title>$title</title>";
echo "<category>$department</category>";
echo "<link><a href="$link">$link</a></link>";
echo "</item>";

}

echo "</table>";

}

?>

</channel>
</rss>
</body>
</html>

Create Php.ini
The support of hosting contracted indicates that I
must create a file php.ini in the folder wwwroot/in
which I indicate the new directors for the values of
upload_max_size, memory_limit, post_max_size,
max_input_time, max_execution_time to me which I need.
Using the function ini_set. The truth I have proven of
many forms and it does not manage to do it if somebody
knows to use this function or similar configuration I
thank for them.

Help Need To Create Pdf
I want to create pdf files on fly. Is there any class is available?

Can Php Create A New Txt File?
I'm trying to build an e-card page for a client using php, but they don't want to use a mySQL database, so I was wondering if PHP can create new text files when someone enters their information into a form and then the recipient gets an email with that txt file reference in a link and can then go to a page that populates with that particular text.

Does it sound like I'm on the right path?

PHP Create .htaccess
Can PHP create a .htaccess file?

Using Php To Create Subdomains
Hi i was interested in knowing if php can be to create subdomains and if so can someone point me in that direction.

Create Directories On The Fly...
Just curious to know is it possible to create directories on the fly?

What I have done is created a script when you can add categories and subcategories, but what I would like to do is create a directory physcially within that category. For instance using the mkdir command using linux. In a way traversing through and creating a directory.

An example would be:

If I created a category called business and econony then it would display this in the address bar.

http://www.domain.com/Business_and_Economy

Then perhaps under Business and Economy, a category called Accounting, then it would display the following:

http://www.domain.com/Business_and_Economy/Accounting/

Hopefully I'm making some sense here.

Heres the code:

function maketree($rootcatid,$level)
{
$sql="select catid,cat_name
from quiz_category
where parentid=$rootcatid
order by cat_name";

$result=mysql_query($sql);

while (list($DBcatid,$DBcatname)=mysql_fetch_row($result))
{
$width=($level+1)*24;
$display="<img src=http://www.domain.com/spacer.gif border=0 width=$width height=12>";
if ($DBcatid==1)
{
$display.="<input type="radio" name="quest_type" value=$DBcatid checked>";
}
else
{
$display.="<input type="radio" name="quest_type" value=$DBcatid>";
}
$display.="$DBcatname<br>
";
echo $display;
maketree($DBcatid,$level+1);
}
}

if ($submit=='Add New Category')
{
if ($new_cat!='')
{
mysql_query("insert into quiz_category
(parentid,cat_name) values ($quest_type,'$new_cat')");

# need to create directory here

echo "<br><br><center><b>New category entered</b></center>";
}
else
echo "<br><br><center><b>New category name must be entered</b></center>";
}

Using Php To Create .htaccess
if you have a form with two variables, USER and PASS, how do you encode them to the format for a .htaccess password protection file?

Cannot Create A URL With Two Variables
I wish to create a url with two variables from data passed from a previous page. If I allocate text to the variables on the page, like

$linkaddress = (&#391234;');
$clientsemail = ('olympic@mechan.freeserve.com');

the full correct URL is echoed back thus

http://www.morgle.com/mymorglemailer.php?mylinkaddress=1234&calledemailaddress=olympic@mechan.freeserve.com

However, if I try and create the URL with the variables posted from the previous page , the URL is truncated after the first variable thus

http://www.morgle.com/mymorglemailer.php?mylinkaddress=1234

I know the variables being posted from the previous page contain data because I have echoed them back seperately ok.

Create A Timestamp
I have a date YYYY/MM/DD and a houte HH:MM and want to create a timestamp
from it. The date is easy but how do I add the time?

Create FTP Account
It's there any way to create a FTP account with PHP?

Create Table Using PHP
use mysql_query ? what's the parameter of string query ?

Create DB Table
how to create a table in a SQL database using PHP3. I can login via telnet and create a table but that is sorta worthless considering that I'd like to be able to do it via a browser instead. Would someone please post some quick code to point me in the right direction?

Create New Line
I am not sure I post to correct forum or not, anyway, my question is

I create some textfield in tabular format (in loop 10 times). Now I want
to add function "add new line" where I click ADD, it will create new text
field shown in the form, is it possible to do?

Create Database
I have basically an install script that creates a database and all the tables and fields.
This works great on the local IIS I have on this machine, but that's because I have 1 password for all databases. THe database cannot be created when I run this on the server that hosts my websites (which is a remote server that I rent space on, it's not in my control).

I'm trying to figure out if what I want to do is possible. I want to have a script that creates a database on any server via a web page.

How To Create Site Map?
how to create sitemap? the sitemap i'm having now, if i want to add or modify things, i have to do it in the code.

PHP Create Directory.
im strugling with this for days now... so please help ih you know...

it's UNIX server,

i'm trying to find working script that would create directories
recursively...

script is in www.server.com/cp/uploadfiles/script.php
and function should be called like 'createDir ("../../files/aa/bb")'

-> only "../../files" exists.

SQL Create Table From Pdf
I would like to use a routine which has as input a pdf form file and returns
the SQL statement to create the table for a SQL database.

Did someone know such a tool?

How To Create An Image On The Fly?
I've created an image with this code

Header("Content-Type: image/png");
$image = ImageCreate($W,$H);
$white = ImageColorAllocate($image,255,255,255);
$black = ImageColorAllocate($image,0,0,0);
ImageLine($image,0,0,$W,$H,$black);
ImagePng($image);
ImageDestroy($image);

but now I wish to add a line

echo "Hello";

before the image code, then I only get garbage, the header command is
probably invalid now. So how do I create the image without having to save
the image to a file?

PDF To Create A Picture
Hey is there a way to create a picture of a PDF? Such as a user uploads a PDF. Then I want to display the first page to the PDF as an image. How would I do that without creating an image with photoshop or such like program?

Can't Create New File
I have a small PHP script that will convert text into vcard format and write it to a new .vcf file (plain text). To write, I've used PHP Code:

Create/copy
what i want to do is have it when someone signs up it creates a folder with their username on the server and copyies files to that folder....

Create Maps
I'm building a weather web site and want to generate weather maps with php. I just created a database with temps, max, mins, etc.. (easier than I thought, this php stuff is great). Now I want to extract that data and plot them on a map (plot a few cities with their temp and weather icon (.gif file))

Using Php To Create Zip Files
can anyone point me to a resource/tutorial on creating zip files using
php? I've gone through 4 tutorials and none have worked. If you've
used one that has worked for you that would be a huge help.

How To Create A Snapshot Of A URL In PHP?
Given a URL I want the snapshot of that page as an image. Something
like
http://pthumbnails.alexa.com/image_...tp://google.com

How do I achieve this in PHP?

How To Create An Array?
how to create an array that contains cat01, cat02,cat03..., cat17 and the cat01 has a value equal to 1, cat02 has a value = 2, cat17 has a value =17 ??? (means every cat01-cat17 has a value assigned to).

Can't Create Databases
In the code below, the mysql_connect commands work correctly (though
I've changed the passwords here). I get the "We were able to
establish a connection" message. But then the code hangs and does
nothing. What am I doing wrong? The username and password are root, so
I should have the right permissions. The same username and password,
when I put them into phpMyAdmin, allow me to create databases without
a trouble.












$link = mysql_connect('localhost', 'u345', &#55614;&#57286;');
if ($link) {
echo "<p>We were able to establish a connection to the
database.</p>";
} else {
die('Could not connect: ' . mysql_error());
}


$result = mysql_create_db($website);
if ($results) {
echo "The database '$website' was created.";
} else {
die("There was a problem. We were not able to create the database.
It is possisble that a database of the same name already existed, or
perhaps someone recently changed the configuration of the database
server. YOu might want to contact whoever is in charge of the database
and ask them what is up :". mysql_error());
}

Image Create?
i need to create a php image like pie chart and i can create that but when i create it dynamicaly and the chart data will come from database then i cant understad that how will i do that. is there anybody who can help me how will i use database to make a pie chart.


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