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'>
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

difference between datetimes
($row['totime']-$row['fromtime'])/60

this is giving me 0

example of totime and fromtim

Can't get the unicode character
I'm trying to get some text from various parts of a file. I have converted the file to hex (bin2hex)

Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri

Merger of 6 sister companies under one flagship company after go live
Dear Experts,
I need one help regarding Merger of sister companies of same group. currently we

SAP Management Console is blank
Dear All ,

I am facing problem in my des sever suddely in SAP Management Console is blank and

Different actions for different parts of a string
<?php
function dosomething($string, $else = '') {
if (empty($else))
$string

Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm

POST into Array problem
Hi Chaps,

I have a repeat region, displaying rows of data: jobid, fromtable, translatorcharge

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

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