/    Sign up×
Community /Pin to ProfileBookmark

onclick problem using php

hi,

when i am using onClick on input field and mixing php with onclick im getting javascript error,anbody help me in this situation

<input type=”radio” name=”ddir” value=”<?=$r->sys_pk ?>” onclick=”sqlDoTable($names);” id=”dir<?=$r->sys_pk ?>” />
function sqlDoTable ($result) {
print “<table border=1 cellpadding=3 cellspacing=0>”;

print “<tr>”;
for ($i=0;$i < mysql_num_fields($result);$i++) {
print “<th>” . mysql_field_name($result, $i) . “</th>”;
}
print “</tr>n”;

// Print table Content
for ($i=0;$i < mysql_num_rows($result);$i++) {
print “<tr>”;

$row = mysql_fetch_row($result);
foreach ($row as $value) {
// Make sure 0’s are displayed
if (is_numeric($value)) { $value = (int)$value; }

// Make sure table is displayed correctly
if (empty($value) && ($value !== 0)) { $value = “&nbsp;”; } else { $value = htmlspecialchars($value); }
print “<td>$value</td>”;
}

print “</tr>n”;
}

print “</table>”;
}

actully the problem is when i select some directory in this link [url]http://server2.vitodesign.com/scripts/test.phtml[/url] i am getting Jscript error

if anybody help me out how i can print this tvalue exactly below these directories will be very helpful

thanks in advance

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@QuasiboboAug 15.2003 — Simple answer:

Javascript (onClick) is a clientside-function, PHP is serverside. You can't mix them (unless you submit values by posting them, but then, your REALLY are just posting..)
×

Success!

Help @zuzupus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...