NYCPHP Meetup

NYPHP.org

[nycphp-talk] Having problems with PHP or maybe something bigger...

Anthony Wlodarski aw at sap8.com
Tue Jul 24 12:09:09 EDT 2007


Donald,

Thanks for the recommendation, I tried it and it did not work.  I even
looked up one level to the function that calls this function and I couldn't
trace back and incorrect code.  I moved the code out of the function and put
it in its own php file:

<?php

		echo "<form action='./edit.php' method='post'>\n";
		echo "<input type='hidden' name='id'
value='".$row['id']."'>\n";
		echo "<input type='hidden' name='database'
value='candidate'>\n";
		echo "<input type='submit' name='edit' value='Edit'>\n";
		echo "<form>\n";
		
?>

Results: It pointed to edit.php.  This is weird and mind blowing as well.

Anthony Wlodarski
Technical Recruiter
Shulman Fleming & Partners
646-285-0500 x230
aw at sap8.com

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Donald Organ
Sent: Tuesday, July 24, 2007 11:15 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Having problems with PHP or maybe something
bigger...

try turning
	echo "<form action='./edit.php' method='post'>\n";
into
	echo "<form action='/edit.php' method='post'>\n";

On Tue, 2007-07-24 at 11:08 -0400, Anthony Wlodarski wrote:
> Hello all,
> 
> I am currently contracted by my boss to create a candide/company tracking
system in PHP/MySQL and have hit a little snag.
> 
> Here is the code:
> 
> function displayCandidates($managerid)
> {
> 	$sqlcandidates = "SELECT * FROM `candidate` WHERE `managerid` =
".$managerid."";
> 	$resultcandidates = mysql_query($sqlcandidates) or die('Error, get
candidates query failed');
> 
> 	while($row = mysql_fetch_array($resultcandidates, MYSQL_ASSOC))
> 	{
> 		echo "<tr style='border: solid 2px black; background-color:
".$row['color']."'>\n";
>     		echo "<td style='border: solid 2px black; width:
100px;'></td>\n";
> 		echo "<td style='border: solid 2px black; width:
300px;'></td>\n";
> 		echo "<td style='border: solid 2px black; width:
300px;'>".$row['name']."</td>\n";
> 		echo "<td style='border: solid 2px black; width:
100px;'>".$row['status']."</td>\n";
> 		// add a edit button
> 		echo "<td style='border: solid 2px black; width: 100px;
text-align: center;'>\n";
> 		echo "<form action='./edit.php' method='post'>\n";
> 		echo "<input type='hidden' name='id'
value='".$row['id']."'>\n";
> 		echo "<input type='hidden' name='database'
value='candidate'>\n";
> 		echo "<input type='submit' name='edit' value='Edit'>\n";
> 		echo "<form>\n";
> 		echo "</td>\n";
> 		echo "</tr>\n";
> 	}
> }
> 
> Now that code would create a button at the end of the table row that
should call the php file "edit.php" however when I go to the webpage the
button links to "names.php" which is the name of the file that contains this
code.  I do have references to $_SERVER['PHP_SELF'] in the code in other
places to call the script itself if certain buttons are pressed but I don't
see how that could have interfered.  It is blowing my mind because I thought
it would be a simple thing to fix but I can't figure it out.  I even moved
the form echo statements to a test file on the server and it does not do
this at all.
> -Anthony W.
> Technical Recruiter
> Shulman Fleming & Partners
> aw at sap8.com
> 646 285 0500 x230
> 
> 
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php






More information about the talk mailing list