473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

form input problem

Hi

I've got a form with an input field called 'cluster' and which posts
to another page where $cluster is printed.

The problem is if for instance I put ABCD in the field I get
ABCDcluster=ABCD printed on the next page and not just ABCD which is
what I want.

see http://convoluta.cap.ed.ac.uk/Lumbri...ibasetest1.php
for a demo.

I can use a regex to get rid of the extra text but can anyone tell me
where it's coming from?

Scripts below.
Many thanks for any suggestions.

lumbribasetest1.php

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta name="keywords" content="earthworms, blast, Lumbricus,
pollution">
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (X11; I; Linux
2.2.13-0.9 alpha) [Netscape]">
<title>Lumbribase Search</title>
</head>

<body text="#000000" bgcolor="#E0EEEE" link="#0000EF" vlink="#51188E"
alink="#FF0000">
<center>

<!--#############################################
#### Banner at top of page ####
#############################################-->
<table WIDTH=80% border=0 cellpadding=0 cellspacing=0>
<tr>
<td WIDTH=33%><P><IMG SRC="earthworm.jpg" WIDTH=100%
HEIGHT=112></P></td>
<td WIDTH=34% align=center bgcolor="#556B2F"><font size=6
color=#FFFFFF> LumbriBASE<br>searches</font></td>
<td WIDTH=33%><P><IMG SRC="earthworm.jpg" WIDTH=100%
HEIGHT=112></P></td>
<tr>
</table>

<br>

<!--#############################################
####search by cluster/clone/protein name ####
#############################################-->
<table WIDTH=80% BORDER=0 CELLSPACING=0 CELLPADDING=10
bgcolor="#AADAAA">
<form method="post" action="pg_nametest1.php">
<tr><td align=center><font size=5>Search by sequence
identity</font></td></tr>
<tr><td align=center><i>L. rubellus</i> cluster (e.g. LRC00138) or
<i>C. elegans</i> protein (e.g. CE01234)</td></tr>
<tr><td align=center><input type="text" name="cluster"><input
type="submit" value="Search"></td></tr>
</form>
</table>
</body>
</html>

pg_nametest1.php

<?php

if($cluster) {
print "What you entered in the text field should be between these
stars *$cluster*";
}
else {
print "You didn't enter a cluster name";
}
?>
Jul 17 '05 #1
8 1741
I noticed that Message-ID:
<5b**************************@posting.google.com > from annie contained
the following:
I can use a regex to get rid of the extra text but can anyone tell me
where it's coming from?


Odd. I can't reproduce the error. Have you tried escaping the stars?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
I noticed that Message-ID: <fh********************************@4ax.com>
from Geoff Berrow contained the following:
I can't reproduce the error.

Here is how I tried
http://www.ckdog.co.uk/php/test/stars.php

<form method="post" action="">
<tr><td align=center><font size=5>Search by sequence
identity</font></td></tr>
<tr><td align=center><i>L. rubellus</i> cluster (e.g.
LRC00138) or
<i>C. elegans</i> protein (e.g. CE01234)</td></tr>
<tr><td align=center><input type="text"
name="cluster"><input
type="submit" value="Search"></td></tr>
</form><?php

if($cluster) {
print "What you entered in the text field should be between
these
stars *$cluster*";
}
else {
print "You didn't enter a cluster name";
}
?>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3
annie wrote:
I've got a form with an input field called 'cluster' and which posts
to another page where $cluster is printed.

The problem is if for instance I put ABCD in the field I get
ABCDcluster=ABCD printed on the next page and not just ABCD which is
what I want.
(snip)
pg_nametest1.php

<?php

if($cluster) {
print "What you entered in the text field should be between these
stars *$cluster*";
}
else {
print "You didn't enter a cluster name";
}
?>


Is this your full pg_nametest1.php?

If it isn't (because you have register_globals off) how do you set
$cluster?

What is the contents of $_POST?
try <?php echo '<pre>'; print_r($_POST); echo '</pre>'; ?>
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #4
Very curious???

If I put a second text field on the form both variables are fine when
they get to the next page!

example:-
http://convoluta.cap.ed.ac.uk/Lumbri...ibasetest2.php

So what is going on???

I'm on Linux 2.4.20, PHP 4.2.2-17 and Postgresql 7.3.2-3. I haven't
been able to come up with an apache version.

Cheers
Jul 17 '05 #5
annie wrote:
Very curious???

If I put a second text field on the form both variables are fine when
they get to the next page!
What happens if you add a hidden field?

<input type="hidden" name="strange" value="very">

example:-
http://convoluta.cap.ed.ac.uk/Lumbri...ibasetest2.php

So what is going on???
No idea. It works as expected for me.
I'm on Linux 2.4.20, PHP 4.2.2-17 and Postgresql 7.3.2-3. I haven't
been able to come up with an apache version.


Not that it matters, but you can get Apache's version with
apache_get_version()

http://www.php.net/apache_get_version

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #6
As others are not able to replicate the error I guess it must be
something to do with the server setup though I'm totally baffled as to
why it works for froms with more than one input field.

For now I'll stick with the very dirty regual expression fix. Thanks
for your help anyway.

Annie
Jul 17 '05 #7
"annie" <ba****@hotmail.com> wrote in message
news:5b*************************@posting.google.co m...
As others are not able to replicate the error I guess it must be
something to do with the server setup though I'm totally baffled as to
why it works for froms with more than one input field.

For now I'll stick with the very dirty regual expression fix. Thanks
for your help anyway.

Annie


Yup, it's definitely a bug somewhere in your copy of PHP. When I did a post
against your phpinfo page I saw this:

_POST["cluster"] => Hello worldcluster=Hello world

To bypass this bug, stick this into your form tag so that PHP uses a
different code path to parse the form data:

enctype="multipart/form-data"
Jul 17 '05 #8
Pedro Graca <he****@hotpop.com> wrote in message news:<2g************@uni-berlin.de>...
annie wrote:
Very curious???

If I put a second text field on the form both variables are fine when
they get to the next page!


What happens if you add a hidden field?

<input type="hidden" name="strange" value="very">



Thanks Pedro, The hidden field works and it's a better fix than mine.
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Norman Bird | last post by:
I have a form i will use to register new people and when I click the submit button, the form just shows itself. It is supposed to show a message showing field errors if you leave fields blank etc....
6
by: Jeff Dunnett | last post by:
Hello, I have written the following HTML Form: <html><head><title>Survey</title></head> <body bgcolor="black" text="white" link="#f6b580" vlink="#c0c0ff"> <img src="logo.gif" width="324"...
9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
5
by: Paxton | last post by:
I created an html email containing a form whose method is POST. The form is posted to an asp page for processing, but no values are retrieved. So I response.write all the Request.Form fields, and...
2
by: francisco lopez | last post by:
Yesterday I had a problem with a javascript to validate my form, but you helped my out yesterday and it works now perfectly!!! so thank you!!! the problem I have now is the following: I put...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
1
by: TopherB | last post by:
Hi, First let me say that my knowledge of HTML and Javascript is fairly limited. But I am stuck in a situation of trying to adapt a website's shopping cart to a new one. Here's the problem, the...
1
by: fugaki | last post by:
Hi everyone I'm learning asp, and i downloaded this script to teach me how to post form data from a webpage to an access database. I put it on the server so i could make sure that it worked, and...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.