Echoing If Function?


Posted on 16th Feb 2014 07:03 pm by admin

A script I am using has If statements in the comments form to basically tell the form what to do. Currently the form works by opening in a pop up for those who want to read/write comments. I'm changing it so that the form displays on the same page, essentially removing the need for a pop up. I have,

Code: if ($_GET['comment']) {
echo "<SCRIPT LANGUAGE='JavaScript'>
Did you know?Explore Trending and Topic pages for more stories like this.
function smiles(which) {
document.form1.text1.value = document.form1.text1.value + which;
}
</SCRIPT>
<form name='form1' method='post' action='comments.php?load=comments&view=add'>
<input type='hidden' name='aid' value='".$_GET['aid']."'>
<input type='hidden' name='name' value='".$_COOKIE[$pre."username"]."'>
<table cellspacing="0" cellpadding="1" border="0" align="center">
<tr><td><b>Name</b></td><td>".$_COOKIE[$pre."username"]."</td></tr>
As a snippet of some of the code. I want to know how I can make the If statement form appear on the page without removing,

Code: if ($_GET['comment']) {
As it would break the script since 'comment' is needed for the form to proceed without errors. I've tried variations of echo on $_GET['comment'] but it didn't do anything.

Hope that made sense, any ideas?
No comments posted yet

Your Answer:

Login to answer
173 Like 13 Dislike
Previous forums Next forums
Other forums

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

PHP page loading in Firefox but not in IE
hello,

i am currently doing a project in PHP and i have a problem. If I view the project in M

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

retrieving images from mysql database using php
So I've been trying to figure out how to store images in a mysql database, and as far as i can tell

Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..
Code: echo "<t

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

COOIS - Saving Object Overview WIP Status layouts
COOIS - Would like to be able to save the layout of an Object Overview - WIP Status report. There i

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash