mem0ri Posted March 7, 2006 Share Posted March 7, 2006 EDIT: SOLVEDBeen sittin' for ages tryin' to figure out what's wrong......page comes up...but when the "submit" button is pressed, nothing happens...nothing at all...Funny thing is, it all worked fine until I cut and paste the HTML into PHP.[code]<?php require("MySQLQueries.php"); require("FormsandHeaders.php"); include("FCKeditor/fckeditor.php"); $edited = @$_POST['Submit']; $toedit = @$_GET['edit']; $pagename = "PageAdmin.php"; $header = getHeader(); echo($header);?><table align="center" width="780"><tr><td> <?php $menu = getMenu(); echo($menu); ?> </td><td align="right"> <?php if($toedit) { echo("<form action=\"PageAdmin.php\" method=\"post\">"); $retrieved = fetchSingle("content","$pagename","page","db"); $retrieved = $retrieved['text']; $oFCKeditor = new FCKeditor('PageEntry'); $oFCKeditor->BasePath = '/FCKeditor/'; $oFCKeditor->Value = $retrieved; $editor = $oFCKeditor->Create(); echo("<input name=\"Submit\" type=\"button\" value=\"Submit Page\"></form>"); } else if($edited) { $author = "Admin"; $update = editValue("content","text,author","'$edited','$author'","page = '$pagename'","schaeffer"); echo($update); } else { $retrieved = fetchSingle("content","$pagename","page","db"); $retrieved = $retrieved['text']; $form1="<table><tr><td>"; $form1.=$retrieved; $form1.="</td></tr>"; $form1.="<tr><td align=\"right\"><a href=\"$pagename?edit=yes\">Edit</td></tr>"; $form1.="</table>"; echo($form1); } ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4380-help-debug-this-form/ Share on other sites More sharing options...
corbin Posted March 8, 2006 Share Posted March 8, 2006 [code] $form1="<table><tr><td>"; $form1.=$retrieved; $form1.="</td></tr>"; $form1.="<tr><td align=\"right\"><a href=\"$pagename?edit=yes\">Edit</td></tr>"; $form1.="</table>";[/code]Unless I'm crazy, which I wouldnt doubt that I am, if you define a variable multiple times and then echo it, it will echo the most recent definition...So try something like[code]$form1="<table><tr><td>". $retrieved . "</td></tr><tr><td align=\"right\"><a href=\"" . $pagename . "?edit=yes\">Edit</td></tr></table>";[/code]Also, I'm not sure, but I've never seen echo (something) used before... Maybe try echo $form1; Quote Link to comment https://forums.phpfreaks.com/topic/4380-help-debug-this-form/#findComment-15291 Share on other sites More sharing options...
greycap Posted March 8, 2006 Share Posted March 8, 2006 [!--quoteo(post=352748:date=Mar 7 2006, 10:18 PM:name=Corbin)--][div class=\'quotetop\']QUOTE(Corbin @ Mar 7 2006, 10:18 PM) [snapback]352748[/snapback][/div][div class=\'quotemain\'][!--quotec--]Unless I'm crazy, which I wouldnt doubt that I am, if you define a variable multiple times and then echo it, it will echo the most recent definition...[/quote]Thats not redefinition, its concatenation. Notice the .=? Its like saying $form = $form . "string";The problem is actually in your html, not your php. A submit button isnt of type button, its of type submit.<input type="Submit" name="Submit" /> Quote Link to comment https://forums.phpfreaks.com/topic/4380-help-debug-this-form/#findComment-15297 Share on other sites More sharing options...
mem0ri Posted March 8, 2006 Author Share Posted March 8, 2006 Ouch...talk about a simple overlook...thank you so much greycap! I would have stared blankly at the code forever...hah.And yes...greycap is also right that I'm doing concatenation with a "$form .=" ...it's a lot easier than doin' "$form = $form." Quote Link to comment https://forums.phpfreaks.com/topic/4380-help-debug-this-form/#findComment-15424 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.