/    Sign up×
Community /Pin to ProfileBookmark

Php page does not get loaded

I have the following php code on a separate page named serverqrys.php
<?php
mysql_connect(“localhost”, “root”, “”) or die(mysql_error());
echo “Connected to MySQL<br />”;
mysql_select_db(“buildingpoint”) or die(mysql_error());
echo “Connected to Database”;
?>

And a java script function that displays a form again on button click

function showform(controlId)
{
var mycontrol=document.getElementById(controlId);
if(mycontrol.style.display==”none”)
mycontrol.style.display=”block”;
}

and my html page with the form looks something like this:
<a href=”#” onclick=”showform(‘postjob’);”>POST A JOB</a>
<form id=”postjob” name=”postjob” action=”serverqrys.php” method=”post” style=”display:none;”>
<table><tr><td>Name:</td>
<td><input name=”loged_name” type=”text”/></td>
</tr>
// other form controls bla bla……………..

<tr><td colspan=”2″ align=”center”><input name=”post_job” type=”button” value=”SUBMIT” /></td>
</tr></table></form>

when I click the submit button the php page is not shown but when I test the php page alone without calling it from the html page it works fine. Where am I going wrong?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Scovia 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.19,
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,
)...