473,569 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PLEASE HELP - Very odd problem

I am new to PHP and I am having a very odd problem. Could some PHP
guru please help.

I am passing some variables from one page to the next, and in the
starting page, I have:

<div id="navigation " align="center">
<form NAME="addnewpoe tpoemform" METHOD="GET"
ACTION="addpoet poem.php">
<table align="center">
<tr>
<td width="20%">Poe t Name:</td>
<td width="80%"><in put TYPE="text" NAME="newpoet" SIZE="30"
MAXLENGTH="30"> </td>
</tr>
<tr>
<td width="20%">Poe m Name:</td>
<td width="80%"><in put TYPE="text" NAME="newpoem" SIZE="30"
MAXLENGTH="30"> <$
</tr>
<tr>
<td align="center"> <input TYPE="SUBMIT" VALUE="Add Poet and
Poem"></td>
</tr>
</table>
</form>

When the receiving page opens I can see, in the URL text box the
values that have been passed in.
However, I am unable to echo these values. If I have:
<table>
<tr>
<td>
<?php
// import_request_ variables(gP,"" );
$recdpoet=$_GET['newpoet']
$recdpoem=$_GET['newpoem'];
if(isset($recdp oet) and strlen($recdpoe t) 0)
echo $recdpoet;
?>
</td>
</tr>

The page opens completely blank. What might be
going wrong? I have tried uncommenting the above line, but it does not
work.
Any help or suggestions will be greatly appreciated.

Mar 3 '07 #1
12 1484
Rik
cp**********@ya hoo.com <cp**********@y ahoo.comwrote:
I am new to PHP and I am having a very odd problem. Could some PHP
guru please help.

I am passing some variables from one page to the next, and in the
starting page, I have:
However, I am unable to echo these values. If I have:
$recdpoet=$_GET['newpoet']
You forgot to close it with ';'
Any help or suggestions will be greatly appreciated.
While developing, setting display_errors on and error_reporting to all is
a great help. If you had this on top of your page, you'd have spotted it
almost immediately:

<?php
ini_set('displa y_errors',true) ;
error_reporting (E_ALL);
?>
--
Rik Wasmus
Mar 4 '07 #2
On Mar 4, 1:05 am, Rik <luiheidsgoe... @hotmail.comwro te:
cpptutor2...@ya hoo.com <cpptutor2...@y ahoo.comwrote:
I am new to PHP and I am having a very odd problem. Could some PHP
guru please help.
I am passing some variables from one page to the next, and in the
starting page, I have:
However, I am unable to echo these values. If I have:
$recdpoet=$_GET['newpoet']

You forgot to close it with ';'
Any help or suggestions will be greatly appreciated.

While developing, setting display_errors on and error_reporting to all is
a great help. If you had this on top of your page, you'd have spotted it
almost immediately:

<?php
ini_set('displa y_errors',true) ;
error_reporting (E_ALL);
?>
--
Rik Wasmus
and if develop for php5 the following line might also be of interest
for your:

error_reporting (E_ALL | E_STRICT);

Cheers
Martin

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

Mar 4 '07 #3
You are missing the semi-colon after $_GET['newpoet']

To find problems like this, turn on diagnostics by adding this to the start
of your php files:
<?
ini_set("displa y_errors","1");
error_reporting (E_ALL & ~E_NOTICE);
?>

Big suggestion: consider using a debug environment - life will be much more
pleasant. It will take several days to set up, but I think you will find it
is well worth it. After looking at several, I use Eclipse with XDebug:

Bug 169408 - Support for XDebug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=169408
(be sure to locate the pdf with detailed install instructions)

Eclipse PHP Project (PDT)
http://www.eclipse.org/php

--
Mike Russell
www.curvemeister.com/forum/
<cp**********@y ahoo.comwrote in message
news:11******** **************@ z35g2000cwz.goo glegroups.com.. .
>I am new to PHP and I am having a very odd problem. Could some PHP
guru please help.

I am passing some variables from one page to the next, and in the
starting page, I have:

<div id="navigation " align="center">
<form NAME="addnewpoe tpoemform" METHOD="GET"
ACTION="addpoet poem.php">
<table align="center">
<tr>
<td width="20%">Poe t Name:</td>
<td width="80%"><in put TYPE="text" NAME="newpoet" SIZE="30"
MAXLENGTH="30"> </td>
</tr>
<tr>
<td width="20%">Poe m Name:</td>
<td width="80%"><in put TYPE="text" NAME="newpoem" SIZE="30"
MAXLENGTH="30"> <$
</tr>
<tr>
<td align="center"> <input TYPE="SUBMIT" VALUE="Add Poet and
Poem"></td>
</tr>
</table>
</form>

When the receiving page opens I can see, in the URL text box the
values that have been passed in.
However, I am unable to echo these values. If I have:
<table>
<tr>
<td>
<?php
// import_request_ variables(gP,"" );
$recdpoet=$_GET['newpoet']
$recdpoem=$_GET['newpoem'];
if(isset($recdp oet) and strlen($recdpoe t) 0)
echo $recdpoet;
?>
</td>
</tr>

The page opens completely blank. What might be
going wrong? I have tried uncommenting the above line, but it does not
work.
Any help or suggestions will be greatly appreciated.

Mar 4 '07 #4
Mike Russell wrote:
You are missing the semi-colon after $_GET['newpoet']

To find problems like this, turn on diagnostics by adding this to the start
of your php files:
<?
ini_set("displa y_errors","1");
error_reporting (E_ALL & ~E_NOTICE);
?>
Since this is a syntax error, these will have absolutely no effect. The
error occurs during during parsing and before any statements are executed.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 4 '07 #5
"Jerry Stuckle" <js*******@attg lobal.netwrote in message
news:D7******** *************** *******@comcast .com...
Mike Russell wrote:
>You are missing the semi-colon after $_GET['newpoet']

To find problems like this, turn on diagnostics by adding this to the
start of your php files:
<?
ini_set("displ ay_errors","1") ;
error_reportin g(E_ALL & ~E_NOTICE);
?>

Since this is a syntax error, these will have absolutely no effect. The
error occurs during during parsing and before any statements are executed.
Well, then perhaps the part of my post that you deleted would be useful :-)
A debug environment will find errors like this instantly.
--
Mike Russell
www.curvemeister.com/forum/
Mar 4 '07 #6
Mike Russell wrote:
"Jerry Stuckle" <js*******@attg lobal.netwrote in message
news:D7******** *************** *******@comcast .com...
>Mike Russell wrote:
>>You are missing the semi-colon after $_GET['newpoet']

To find problems like this, turn on diagnostics by adding this to the
start of your php files:
<?
ini_set("disp lay_errors","1" );
error_reporti ng(E_ALL & ~E_NOTICE);
?>
Since this is a syntax error, these will have absolutely no effect. The
error occurs during during parsing and before any statements are executed.

Well, then perhaps the part of my post that you deleted would be useful :-)
A debug environment will find errors like this instantly.
One doesn't need a debug environment to find errors like this. Simply
enabling error displays in the php.ini or .htaccess will do it just as well.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 4 '07 #7
Mike Russell wrote:
Big suggestion: consider using a debug environment - life will be much more
pleasant. It will take several days to set up, but I think you will find it
is well worth it.
I considered this, but then decided the best way to avoid those long hours
of bug hunting was to just write code that doesn't have any bugs in it. I
don't know why I never thought of that before -- all those years of
writing code with bugs in it and then debugging it -- much easier just not
to write the bugs in the first place. ;-)

More seriously, no matter how good you get at PHP, these silly little
syntax errors like misplaced brackets and missing semicolons are always
the ones that come back to bite you.

If you (not you in particular, Mike; I am referring to the general "you")
don't already have the command line version of PHP, then get it, and run
"php -l filename" on any file before you try using it. It will catch any
parsing errors in the file.

After that, enabling PHP's normal error reporting should provide fairly
helpful error messages, such as when you don't provide enough parameters
for a particular function, or if you've not implemented a particular
interface correctly, and so forth. When relevant, it tells you the exact
file and line number where the problem is. These bugs are usually fairly
simple to fix.

Then you "only" have to deal with logic errors. :-)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 6 '07 #8
Toby A Inkster wrote:
Mike Russell wrote:
>Big suggestion: consider using a debug environment - life will be much more
pleasant. It will take several days to set up, but I think you will find it
is well worth it.

I considered this, but then decided the best way to avoid those long hours
of bug hunting was to just write code that doesn't have any bugs in it. I
don't know why I never thought of that before -- all those years of
writing code with bugs in it and then debugging it -- much easier just not
to write the bugs in the first place. ;-)

More seriously, no matter how good you get at PHP, these silly little
syntax errors like misplaced brackets and missing semicolons are always
the ones that come back to bite you.

If you (not you in particular, Mike; I am referring to the general "you")
don't already have the command line version of PHP, then get it, and run
"php -l filename" on any file before you try using it. It will catch any
parsing errors in the file.

After that, enabling PHP's normal error reporting should provide fairly
helpful error messages, such as when you don't provide enough parameters
for a particular function, or if you've not implemented a particular
interface correctly, and so forth. When relevant, it tells you the exact
file and line number where the problem is. These bugs are usually fairly
simple to fix.

Then you "only" have to deal with logic errors. :-)
I agree, Tony. I always keep a test server (not available to the
outside world) with all error reporting enabled. It really saves a lot
of time!

I've tried debug environments before, and they're nice. But they're
also slow and cumbersome. I haven't found one I like well other than
Zend - but I'm not going to spend the money for it as little as I need
it. echo statements work quite well.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 6 '07 #9
"Toby A Inkster" <us**********@t obyinkster.co.u kwrote in message
news:dq******** ****@ophelia.g5 n.co.uk...
Mike Russell wrote:
>Big suggestion: consider using a debug environment - life will be much
more
pleasant. It will take several days to set up, but I think you will find
it
is well worth it.

I considered this, but then decided the best way to avoid those long hours
of bug hunting was to just write code that doesn't have any bugs in it. I
don't know why I never thought of that before -- all those years of
writing code with bugs in it and then debugging it -- much easier just not
to write the bugs in the first place. ;-)
Hi Toby,

I understand you are being tongue in cheek here, but it does touch on one of
the reasons that I believe people reject using debuggers and development
environment. Being able to type accurately and quickly write code with few
or no bugs is a high level of skill, and rightfully a source of pride. That
pride seems to be undercut by the suggestion that using a debugger would
help in any way.
More seriously, no matter how good you get at PHP, these silly little
syntax errors like misplaced brackets and missing semicolons are always
the ones that come back to bite you.
Absolutely - a nickle for the number of times I've left the single quotes
off a field name, or had a backwards if.
If you (not you in particular, Mike; I am referring to the general "you")
don't already have the command line version of PHP, then get it, and run
"php -l filename" on any file before you try using it. It will catch any
parsing errors in the file.
I appreciate your consideration, as well as your useful suggestion re the -l
option. It's nice, too, to have a red wavy line appear under the syntax
error immediately as you type it, or xtrl-space give you a selection of
function names.
After that, enabling PHP's normal error reporting should provide fairly
helpful error messages, such as when you don't provide enough parameters
for a particular function, or if you've not implemented a particular
interface correctly, and so forth. When relevant, it tells you the exact
file and line number where the problem is. These bugs are usually fairly
simple to fix.

Then you "only" have to deal with logic errors. :-)
There you go - I sense a universe of hard-earned knowledge in your use of
the word "only". Logic errors do not produce syntax errors, and knowing
where to place the echo statement often means knowing where the bug is.

Another example is learning about PHP itself, or dealing with a large
existing body of code. For example, I'm about to dive into a mature forum
system that includes 306 source files, and dozens of database tables. With
a debug environment, I can set a breakpoint at a piece of code I'm wondering
about, see all the variables (not just the ones I think I might be
interested in), and follow the chain of execution arbitrarily. These are
all very powerful abilities that I have learned are necessary for me to work
efficiently.

For me the decision of whether to use a debug environment is not even a
close call. If it's available I want it. If it's not, I'll slog along with
embedded echo's.

If you work well without a debugger, more power to you. IDE's and debug
environments are used by skilled professionals all the time, and I hope you
will forgive me if I suggest that, as experienced and productive as you are,
you would be even more productive with a *good* debug environment.
--
Mike Russell
www.curvemeister.com/forum/
Mar 6 '07 #10

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

Similar topics

21
2776
by: Applebrownbetty | last post by:
Hi, I've run into a problem with IE 6 vs. Mozilla when displaying a completely CSS positioned page, and was wondering if any resident CSS guru might quickly be able to find the problem(s). Thank you. In IE, the page looks how I want it to look (picture below): www.sunbadgeco.com/sunmetal/ie.jpg In Mozilla Firefox, somehow it's not quite...
0
1688
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web browser that Hotmail does not support. If you continue to use your current browser software we cannot guarantee that Hotmail will work correctly for...
4
3507
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this Fixpack on a test machine running ESE but encountered a serious error during the install. It started 'copying new files' but then stopped cold and...
23
3245
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
2
1382
by: Carlo, MCP | last post by:
Hi, Sorry for posting twice, but I hope in your comprehension. Please help me! I'm troubling from months with a serious serialization problem that I'm not able to solve. I try to describe as simply as I can. 1) I have a class tha does something with colors. All default values are obviously NOT serializad. Instead, they are serialized...
1
9607
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the...
1
1632
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im facing a problem in opening some forms from command button a message appear the openform action was canceled and when i open them from the database...
1
1595
by: oldgent | last post by:
I am having a problem installing the starter kits. I have reinstalled VS 2005, think that might be the problem. I then installed both 'Personal Website" and the "Club Website" starter kits. I still have the same problem. Any web starter kit that is installed under 'My Templates" does not allow you to enter the location directory or use the...
1
54484
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and we instruct our experts to ignore any such PMs completely Be sure to give the version of Access that you are working with and the Platform and OS if...
2
3520
by: violeta123 | last post by:
I am stuck! Please help It might be difficult to explain the problem via email, but I will try. I have a Win 2003 Enterprise server running with the only purpose of a membership web site that uses SQL server 2000 database. I had the site for over 5 years, but the problem started about 6 months ago. At random times (at least I have not...
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.