Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

PHP Bug?

I stuck some PHP code in my sidebar and now I can't put anything else in it, or get the PHP code out! I guess I'll look in CopyBoy and see if I can get at it that way.

www.marktaw.com
Sunday, April 06, 2003

Uh... where is CopyBoy? I couldn't find the link.

www.marktaw.com
Sunday, April 06, 2003

check out tk's site.  he has it linked

Joel Goldstick
Sunday, April 06, 2003

Use CTRL-A in the sidebar before deleting.

Jorgen Brenting
Sunday, April 06, 2003

Here is Mike's copy boy:

http://www.larkware.com/Products/LarkwareCopyBoy.html

and thanks to Mike!

tk
Sunday, April 06, 2003

If you have Access, you can open the .cty file and delete what you don't want.

Eric
Monday, April 07, 2003

I did CTRL + A, and Edit / Select All... nothing worked.

My eventual fix was to replace the article, but I never compacted the site so it should be floating around in there if Fog wants to take a look at it.

here's the code you can test it for yourself:

<?
if ( ($_POST[email])  != "" )
{
$db_name = "prosoun_email";
// echo "$db_name";
$table_name= "list";
// echo "$table_name";
$connection = @mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
// mysql_select_db ("prosoun_phpnuke");
// echo "$connection";
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
// echo "$db";
$sql= "INSERT INTO $table_name (email)
Values ('$_POST[email]')";
// echo "$sql";
$result = @mysql_query($sql,$connection) or die(mysql_error());
// echo "$results";

echo "<table><tr><td bgcolor=FFFFFF><p><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
Thank you. We will e-mail on once the site is live.</font><p>
</td></tr></table<";
}
else
{
echo "
<table>
<tr> <form name=post method=post action=index.php>
<td bgcolor=FFFFFF><p><font size=2 face=Verdana, Arial, Helvetica, sans-serif>We're still tweaking and making last minute changes.</font></p>
<p><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Enter your e-mail
address to be contacted when ProSoundReview.com is up &amp; active. We promise
not to give it to anyone or spam you.</font></p>
<p><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
<input name=email type=text id=email value=>
<input type=submit name=Submit value=Submit>
</font></p></td></form>
</tr></table> ";
}

?>

Here's what you do.

Create a temporary file & paste this code into it in HTML view.

Then clear your copy/paste buffer, maybecopy something else into it instead like some miscelaneous text.

For some reason I was able to go into Normal view once to copy/paste it into the sidebar view... Maybe because I had the raw code in my buffer already and that's what got pasted? It would show up as as a character that only showed up sometimes, kind of like a carriage return does.

Then a few days later I wanted to edit the sidebar, and I couldn't select the text either from the temp file or the side bar. I can't select the code in normal view from the temp file now either.

I wonder if I could if I added some spaces before / after the code, and somehow that would give CityDesk something to "grab" in normal view?

www.marktaw.com
Monday, April 07, 2003

I've been unable to recreate your bug.

David Burch
Monday, April 07, 2003

Huh. Try again after you've had time to reboot your PC. That'll ensure your copy/paste buffer is cleared. Remember, paste it into the HTML view, and then try copy/paste from the normal view.

I'm using version 1.0.31

www.marktaw.com
Monday, April 07, 2003

Okay, cityDesk removes spaces before/after the <? ?>.

I typed 0 before the first <? and 1 after the ?> like this:

0<? (code here) ?>1

In HTML view it shows up as 01

I was able to select/copy the 01 and paste it and yes it had the PHP code in between. Apparently once it removes the leading/trailing spaces when you switch to normal view, there's nothing to copy/paste.

www.marktaw.com
Monday, April 07, 2003

*  Recent Topics

*  Fog Creek Home