Jump to content

Check out our Community Blogs


Member Since 28 Jul 2010
Offline Last Active Sep 18 2012 06:46 PM

Posts I've Made

In Topic: Php Directory

10 April 2012 - 05:37 PM

did you browse to http://localhost/Codes/filename.php ? what does your code look like? Can you post it to us?

well it is just a simple code actually.



<!-- to display variable value for single qoute, use concatenation which combine to put two strings value together-->
<!-- use single qoute is faster than use double qoute-->
echo 'Farhan'.$Name.'</br>';

<!-- to display string value for double qoute, just insert the variabe along-->

echo "Farhan $Name";

i do this exactly the same as in the tutorial that i refer to.still it doesn't display the right output

In Topic: How to start developing a website

09 April 2012 - 04:00 AM

i think i need to work on the design first, the interface design, the position of each buttons and all.but what matter most would be the database design,i guess.it must be well running.how do you guys usually do the interface?using photoshop or something?

In Topic: html form connect to mysql database

05 March 2012 - 08:15 PM

Back up a second. What's the code for your HTML form and your PHP script that you're using for your simplified echo trial? Double check to ensure you have all your form control names correct. What's the output when you just try to echo the form fields back to the browser?

the output from echo the form is the form that i named it as enrolment. the form is displayed successfully. however, when im trying to submit the data in to the database, nothing comes out. didn't display anything.i've checked everything and it is seems okay.does it got anything to do with something that is out of code?my server or something?Im using xampp anyway.

In Topic: html form connect to mysql database

01 March 2012 - 06:13 PM

oh yeah.i notice the mistake there.well, when i run the program, only the form which is in enrollment.html file that appear in the browser.when i clicked the submit button,nothing was appear.i've checked the file directory, and everything is seems okay.i created a file named codes in the htdocs document and the directory looks like this C:\xampp\htdocs\Codes.why does the output doesn't come out?

In Topic: html form connect to mysql database

01 March 2012 - 10:52 AM

i have these two codes that seems couldn't display output. i don't know what i did wrong in these two codes.please check up for me.

//this is in enrollment.htn
<form action="enrolmentResult.php" method="post">

<legend>Personal Details:</legend>

Name:     <input type="text" name="UserName"/></br>

Male<input type="radio" name="UserGender" value="Male"/>
Female<input type="radio" name="UserGender" value="Female"/></br>

<p> </p>

Address:</br><textarea name="userAddress" cols="30" rows="10" size="5"></textarea></br>

IC Number: <input type="text" name="ICNumber" maxlength="12"/>

<hr size="1S" noshade>

<legend>Course Detail</legend>

Course Name: <select name="CourseName" size="1">
<option selected="selected">Bachelor of Computer Science</option>
<option>Bachelor of Multimedia</option>
<option>Bachelor of Graphic Design</option>


Subject to add:</br>
<input type="checkbox" name="addedSubject" value="IAS 2243" checked="checked">IAS 2243
<input type="checkbox" name="addedSubject" value="ITD 3194" checked="checked">ITD 3194
<input type="checkbox" name="addedSubject" value="IKS1143" checked="checked">IKS1143
 <input type="checkbox" name="addedSubject" value="ISS2131" checked="checked">ISS2131


<hr size="1S" noshade>

<input type="submit" value="Submit"/>
<input type="reset" value="Reset"/>


//this is in enrolmentresult.php
<title>Enrollment Result</title>
<? php

//initialize db data to var

$con=mysql_connect($host, $db_Name, $psword, $user)
or die(mysql_error());

//select database
or die("Couldn't select database");


//insert row to student table
$queryStud="INSERT INTO student (UserName, ICNumber, userAddress, UserGender) Values('$Name','$ICNumber','$Address','$Gender')
mysql_query($queryStud,$con) or die(mysql_error());

//insert row to subject table
$querySubj="INSERT INTO subject (CourseName, addedSubject) Values('$ProgName','$Subj')
mysql_query($querySubj,$con) or die(mysql_error());

//display output
echo"Successfuly added record";


the output doesn't even appear in the browser.what are the errors and how am i suppose to solve them??

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download