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




How Do You Make The Contents Of A Text Box Remain, Even After Clicking Send, With Errors ?


How do you make the contents of a text box remain, even after clicking send, with errors?

At the moment, the visitor inputs a load of text into the comments box, but if they click send and there's errors in other fields on the page, the comments box goes blank and they have to start all over again ...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Clicking Text
is there away to click on any text on a page and have it add that text to a text box? so if i click on the word (phpfreaks) it will add it to a text box.

Changing Variables By Clicking Text Link?
I have a page that I need to change variabels with, based on what link you click on the page.

Basic File Get Contents Errors
I'm a newbie and have been learning PHP on and off for a while now.
I am trying to rebuild my website after my host dissapeared along with all my sites data, and I am very nearly 100% complete to the point prior to data loss.

However, one of the pieces of code written by another programmer is simply baffling me at the moment, and I think it may be due to the fact the code was badly written for a much older version of PHP compared to the version the site is on now with my new host etc

The code should be searching for images from one of my suppliers websites but it runs and does nothing at all...I have checked the suppliers URL's and they match the code so what is going on here....am I missing something really simple?

Send Contents Of Page In Email
is there not an easy way to simply send the contents of a page in the
body of an email? i.e. i have a report.php that pulls from a mysql db.
i need to be able to send the displayed file right in the body of the
email. can anyone help with this?

Displaying Contents Of A Text File?
I'm trying grab the content of a text file and print it a web page. I believe that I should be using something along the lines of "file" or "fopen", but I'm not having any luck. Any thoughts or tips?

List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.

Read A Text File Where Contents Are Going Over 2 Lines
I have this code to read the contents of a text file: PHP Code:

Read The Contents Of A Text File Into MySql Using PHP
New to this, have the basics, can build a form and such. My problem is I
need to be able to open a file on a pc/s on the network, read the data
character by character, check to see if a certain character is present, if
it is, update the database and continue reading the file until it comes
across the character again, updates the database and so on . . . .

Formatting The Contents Of A Text Area Form Field
On my site I get users to enter a load of information in a textarea
box, however when i save this data to my mysql DB and then retrieve it,
it comes out without all the formatting, like new paragraphs and new
lines.

Can anyone tell me how you can capture the data entered into such a
field with all the formatting the user has entered like new paragraphs
etc?

Automatically Make Text Into A Link
how do I make php search through a $_POST[variable] for a certain set of string, lets say R1000000.  Then I would want to turn that string (R1000000) into a link
<a href=example.php?id="R1000000">R1000000</a>Then append that link back into the original $_POST[variable] replacing the R1000000, with the link version. I'm sure this is doable, I just have no idea where to start, regex?

Make Link To Typed Text
Is there some possibility in PHP to do automatic link when somebody type URL in form window? (One or more URL in one text.)

example: www.xxxxxxxx.com to be a <a href="http://www.xxxxxxxx.com">www.xxxxxxxx.com</a>

(as I think, maybe I can do that with chage string when query returned from database, but I must to know how he typed in database in text: only "www..." or begin with "http://www...".) Is somebody have a script how can I change strings?

How To Make Text Wrap In Table Cells?
I don't understand this at all. I have a table with fixed width and height in pixels. Yet when I place a long text string in a cell, the cell expands as far as needed to the right or left to fit the string on one line. This is driving me quite mad. How do I ensure that a long string is displayed in a neat, orderly fashion? My question has nothing to go with wrapping text around images. I just simply need to have text wrapped!

How To Make Text Area Recognize Hyperlinks?
I built a simple form where a user can enter and post news items to his
site (with PHP, into MySQL). He doesn't know much HTML.

Is there some way he can enter some simple text to declare something a
hyperlink, and have PHP recognize that that means "make this text into a
hyperlink"?

....so that instead of having to type this into the textarea:

<a href="http://www.somesite.com">somesite</a>

....he could type something more intuitive, like this:

<somesite.com>somesite</somesite.com>?

Make Text String Read From Right To Left In Imagettftext() Function
I want to write a text string from right to left instead of from left to right with the imagettftext (); function

I read in teh manual that the angle variable controls this, it says that 0 angle means left to right, so I tried 180, 360 but nothing happens

What angle do I need to put it to get it to write it right to left

I am writing a hebrew text string with a font.ttf that supports hebrew characters

<?php   
$white = imagecolorallocate($background, 255, 255, 255);
$fontfile = "davidtr.ttf";
$string = "&#1502;&#1495;&#1500;&#1491;&#1490;&#1499;";
imagettftext($background, 12, 360, 3, 17, $white, $fontfile, $string);
?>

Can Mail() Send Rich Text Emails?
As subject says, does anyone have an idea if it's possible to send rich text emails using mail()?? If it's, does anyone have an example?

How To Send A Plain Text Version Of An Email With Html
how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?

Supress Errors At The Page Level? Undefined Index Errors.
I'm creating a simple reply form, and if a form item isn't answered I
get an error:
"Notice: Undefined index: rb_amntspent in
c:inetpubwwwrootmackinawsurvey.php on line 36"
even if in the code I allow for an unselected item. (Code at the
bottom here.)
It works fine otherwise.

Now in the past I've made a change to php.ini to repress errors, but
for this project I don't have access to the php.ini.
Is there a way to supress errors on that page for that session?

Or, is there a way to just not get that error at all?

Here's a sample of the code that gets the form response. If an item is
selected, no error for that question, but if an item is not selected I
get the error above even though I still get a successful echo for the
"else" or "default" option which occurs if nothing is selected:

$rb_visited = $_POST["rb_visited"]; //Have you ever visited Mackinaw
City, Michigan?
if ($rb_visited == "1") {
$rb_visited_reply = "Yes";
} elseif ($rb_visited == "0") {
$rb_visited_reply = "No";
} else {
$rb_visited_reply = "You did not answer this question";
};

$rb_lastvisit = $_POST["rb_lastvisit"]; //When was your last visit to
Mackinaw ity?
switch ($rb_lastvisit) {
case "1":
$rb_lastvisit_reply = "Earlier this year (2003)";
break;
case "2":
$rb_lastvisit_reply = "Last year (2002)";
break;
case "3":
$rb_lastvisit_reply = "2 years ago (2001)";
break;
case "4":
$rb_lastvisit_reply = "3 years ago (2000)";
break;
case "5":
$rb_lastvisit_reply = "4 or more years ago (1999)";
break;
default:
$rb_lastvisit_reply = "You did not answer this uestion";
}

No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using
/usr/local/etc/php as the directory I make from. However, no matter what
I do, I do not see a php4lib.so that has been created. The documentation
I recieved (an IBM source) says that the following has to be added to the
httpd.conf file :

LoadModule php4_modulelib/apache/libphp4.so
..
..
..
AddModule mod_php4.c

here is the output from my make install :

[root@mail php]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.2
[PEAR] HTTP - already installed: 1.2.2
[PEAR] Mail - already installed: 1.1.3
[PEAR] Net_SMTP - already installed: 1.2.3
[PEAR] Net_Socket - already installed: 1.0.1
[PEAR] XML_Parser - already installed: 1.0.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
program: phpextdist

Alert By Clicking On A Link
Is it possible to set a javascript alert before executing a php script when a hyperlink is clicked. i.e. user clicks hyperlink "delete" to execute delete.php?task=del&id=2

Clicking Pictures To Appear In The Textarea.
I am trying to do a function where you click on the images and these are entered into the textarea. Exactly as if i was clicking on this above and it enters the code for the picture into this textarea.

Sending Form Data Without Actually Clicking?
Is this possibe? Say you wanted to test that a form was working correctly, every so often you could with a cronjob run a script to process the form for you.

Is There A Way To Pass A Form By Clicking On A Link
I was wondering if it's possible for me to create a form where the user can submit the form by clicking on a hyperlink instead of clicking on a button to pass the data. Is this possible?

Attach Files By Clicking The Image
How to attach files by using the image...by clicking the image it will come a pop up message (the attachment page with browser button)...and i can attach the files..

Hitting Enter On A Form Instead Of Clicking The Button
I'm getting incorrect response when hitting the enter key instead of
actually clicking the button on a form. It activates but the post data
[value='Update'] isn't being sent I think. The php generated page
flickers & reloads but doesn't perform the update.

This is php generated, I'm just pasting the page source (reformatted &
extra junk removed and I think they are now identical), and it's running
on my localhost apache server for testing so maybe there's something
funny with my setup. Crossposted to html & php groups.

Must click button (no enter):

<form action='?SC=cart.php' method='POST'>
<tr>
<td>
<input type='hidden' name='item' value=&#55618;&#57133;'>name
</td>
<td>
<input type='submit' name='buy' value='Update'>
</td>
<td>
<input type='text' name='item_qty' size=&#391;' value=&#392;'>
</td>
</tr>
</form>

Enter or click works fine:

<form action='?SC=cart.php' method='POST'>
<tr>
<td>
<input type='hidden' name='item' value=&#55619;&#56572;'>name
</td>
<td>
<input type='submit' name='buy' value='Update'>
</td>
<td>
<input type='text' name='item_qty' size=&#391;' value=&#392;'>
</td>
</tr>
</form>

Here they are without me fixing up the formatting:

Must click button (no enter):

<form action='?SC=cart.php' method='POST'><tr>
<td><input type='hidden' name='item' value=&#55619;&#56572;'>Adiantum jordanii / -
1 gal</td>
<td><input type='submit' name='buy' value='Update'></td>
<td><input type='text' name='item_qty' size=&#391;' value=&#391;'></td>
<td>$&nbsp;9.00 </td><td>$&nbsp;9.00 </td><td>0%</td>
<td>10%</td>
</tr></form>

Enter or click works fine:

<form action='?SC=cart.php' method='POST'><tr>
<td><input type='hidden' name='item' value=&#55618;&#57133;'>Adiantum jordanii / -
1 gal</td>
<td><input type='submit' name='buy' value='Update'></td>
<td><input type='text' name='item_qty' size=&#391;' value=&#392;'></td>
<td>$&nbsp;10.00 </td><td>$&nbsp;20.00 </td></tr></form>
<tr><th colspan=&#394;' align='right'>Tax:</td><td>$
1.70</td><td>&nbsp;</td></tr>
<tr><th colspan=&#394;' align='right'>Delivery:</td><td>$
0.00</td><td>&nbsp;</td></tr>
<tr><th colspan=&#394;' align='right'>Order Total:</th><th>$&nbsp;21.70</th>
<th><form action='?SC=checkout.php' method='post'><input type='submit'
name='checkout' value='Checkout'></form>

Problem With HTTP_REFERER When Clicking On Refresh Button
In a simple webshop application I am trying to check that the "shopping
cart" only should be "filled" when you choose an article in "meerinfo.php"
and click on a link to "winkelwagen.php". It works fine in that sense that
when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will
be ignored.
However when I go from meerinfo.php to winkelwagen.php , the article is
added again and again to the shopping cart when I click on the refresh
button in Internet Explorer. Is there a way to avoid that?

This is the code in winkelwagen.php

if(!isset($_SESSION['artikelen'])) //initiate the array when the first
article is added to the shopping cart
{
$_SESSION['artikelen'] = array();
}
$waarvandaan = $_SERVER['HTTP_REFERER'];
if (strstr($waarvandaan, "meerinfo.php"))
{
$id = $_GET['id'];
$_SESSION['artikelen'][] = $id;
}

Validate Your Account By Clicking On A Link In The Email
i have a registration page and what  whant to do is make it so users have to validate an account by clicking on a link in the email like you see on most sites.

How To Call A Dll File By Clicking An Icon/image In A Webpage
how to call a dll file by clicking an icon/image in a webpage using php.

Moving A File To A Directory By Showing Clicking A Thumbnail
I would like to show a users uploaded files as a clikkable thumbnail which when pressed renames(moves the image into its new directory) I have gotten as far as making them appear as thumbs that link to large images, Code:

Clicking Browser's Back Button Shows An Empty Page
On my website www.lahabitacionroja.com developed using Php I am experiencing the following problem:

When a user with MS Explorer 5.0 or older clicks the back button on the browser it shows an empty page...
If you try with MS Explorer 6.0 this problem doesn't happen.

Does anybody why it happens and if there is any easy solution??

Is it a browser issue, an Apache issue....

Send This Page Script Used To Send Spam.
I had installed a simple php script (obtained for free from the web) that allows a visitor to forward a page to a friend. It worked great but now a spammer is using it to send thousands of emails. I have deleted the feature and also the php file but no successs. What can I do? Please help. While I have some responsibilities of a webmaster, my technical abilities are very limited.

Open .php File With PHP Designer 2007 By Clicking The File In XP
In windows XP, I want to be able to click on a .php file and have it
opened in PHP Designer 2007,
Or right-click on it and have an "edit" menu option presented to me.
I know how to tweak the registry to do this in general, but what would
the command line look like in this specific case ?
PHP Designer does not do this automatically. It is as if the program
does not allow commandline options.
It only opens with the last file used or a menu of recently opened
files.

Send Header Info To A Page, Retrieve Response And Send That As Header
I am sending a header to page.html from sender.php using fgets(). I am then trying to retrieve that page's response, and set that as a header in sender.php in order to set any cookies etc.... that page.html might want to set. Right now I am using the following code:

Submit Form Without Clicking Submit Button
I was wondering if it is possible to use something like Javascript to make it so you don't have to click the submit button on a form to make it submit, while using php and mysql. e.g. Code:

Errors In Php 5.0.4 Not In 4.3.10-16
I use the following statements:

$var = "";
$var = $_POST('varname');

In php 4, when 'varname' was not defined, $var remained an empty string;
In php 5, I suddenly get errors.

I solved these by including the function array_key_exist to check the
occurence of 'varname'
Is this the prefered way or is ther a better solution?

Errors In Php 5.0.4 Not In 4.3.10-16
I use the following statements:

$var = "";
$var = $_POST('varname');

In php 4, when 'varname' was not defined, $var remained an empty string;
In php 5, I suddenly get errors.

I solved these by including the function array_key_exist to check the
occurence of 'varname'
Is this the prefered way or is ther a better solution?

PHP 404 Errors
Some of my visitors keep emailing me about "404 page errors" on my website even though the pages are working perfectly. I have had this problem before , I figured it out and it was because of my "generators" which uses pure PHP codings like this - http://www.generators.hot-lyts.com/linkgen.php.

I had the solution, I made a sub domain and since then I wasn't getting anymore error mails however it occurs again, I have checked the new pages I've added recently and deleted some of them but I still have no luck, I still get tons of mails about this error pages and it is really frustrating because my hits have been dropping big time.

I really have no idea what the problem is with my website. I am not sure if it's my server or some php problems. Code:

File Get Contents()
I need to verify, (working on the HTML section of a mailer), If in my php.ini: allow_url_fopen is On Will file_get_contents(file URL) called as follow:

$mailer->Body = str_replace('{MEMBER_NAME}', $member_name, file_get_content($htmlBody) );

Allows the file to become my email body? where $htmlBody comes from the DB...

Getting And Using Contents In A Folder
I want to make a photogallery/slideshow with PHP...

The 'gallery/slideshow' would show up inside a new window.
basically, I just want links with possibility to go:

- forward
- back
- to the very beginning
- to the very end
- away (close the window)

Can I use PHP to determine the contents of the folder with the pictures and then use variables to determine which photo to show, and what URL's should be generates for the arrows? So each folder with a series of photographs would have one PHP file and the pictures themselves in them (it's not a problem to rename them).

Should be simple enough, but I'm just starting out with PHP, and I'd like to have something working as soon as possible... the website I'm working on is about to launch soon (my first 'commercial' web project :) ), and this is about the only thing left that I still have to sort out how to do...

Add The Contents Of 2 Texbox's
I have designed a form that will display a price (22.34) in
a text box, and another price in the other text box... I also have a blank
text box... Now I want to add both the prices together and get a total in
the bloank textbox..
I got this example off a website sumwhere.. But it does not display the
decimal number, it only displays the whole number

var number1 = parseInt(document.forms[0].CasesSellingPrice.value);
var number2 = parseInt(document.forms[0].AccessoriesSellingPrice.value);
document.forms[0].total.value = number1 + number2;



Getting Address Bar Contents With PHP
How do I get the contents of the browser address bar with PHP - assuming it
is possible?

In javascript it is done with: unescape(window.location.pathname), but is
there a php equivalent?

Getting Contents Of Folder
I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/

I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing.

List Db Contents
can someone help me make a script that will list the information in one colum in my table! See each clan I have has an ID, and CEO and bla bla bla! But what I want done is it to only show the name of the clan in A dropdown menu. So that when users are signing up they can select the clan they want and it well ya you know puts the name beside theres in the table. But can someone make me a script to list all the clans Names and only names not ID, Ceos, and all that other stuff. Code:

Getting The Contents Of A File.
Is it possible to get the contents of a file; display the contents in a textbox; and edit the contents of that file. Then click a button and change the contents to the new updated file.

The reason I want to know this is because I have programmers on my site and I don't want them to have access to the FTP or cPanel. They will jus enter the name of the file, click submit, be able to edt and replace that file. All without FTP or cPanel.

Display Contents In Mb/gb
i was wondering if it was possible using php to display how much in mb or gb how many files in  afolder e.g

folder <-- containg 1,000mb of data

File Put Contents
looking to write to a file with out overwriting the previous data?  is there a way to turn overwrite off with the file put contents?? im trying to keep a log of form data.

File Get Contents
i am trying the example of get_file_contents but i get the following error.

what i want to do is get all the web page of google but the code wont work any ideas please cheers.

Warning: file_get_contents() expects at most 2 parameters, 5 given in

<?php
$content=file_get_contents("http://www.google.com",FALSE,NULL,0,20);
echo $content;
?>

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.

Ereg_replace - Errors
Whenever I use the ereg_replace function like follows:


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