PHP OOP framework? then codeignigter best suites your needs!
PHP OOP framework? then codeignigter best suites your needs!
you dont have a choice... your client wants to select it rather than entered them wich is much faster... you have to use series of html form select... it would be a lot easier if it would be inputed in a textfield like this
<?php
if(isset($_GET['btnsubmit'])){
$number = $_GET['number'];
if(is_numeric($number)){ //validate numeric entry
$min = -40.0;
$max = 150.0;
if(!($number >= $min && $number <= $max)){//range
echo "invalid";
}
}else{
echo "must be numeric";
}
}
?>
<form method='get'>
<input type='text' name='number' />
<input type='submit' name='btnsubmit' value='submit' />
</form>
you can't run php code inside a .html files.... your files should be saved as .php so it will be parsed at the server.
i replied above, but i think you miss it... here it is
<?php echo "<script>window.location='yourpage.php'</script>"; ?>
coz. you directly use $azz variable without first defining it...
define it like this
$azz = $_GET;
just put that above your code, befor you output $azz.
you need to join two tables together
assuming you had these 2 table
ill make this example simple
/* tables */
price
price_id - int(autoincrement)
prod_price - double
acc_establishments
prod_id - int(autoincrement)
prod_name - varchar
price_id - int
/* query */
select ae.prod_name, p.prod_price from acc_establishments as ae join price as p where ae.price_id = p.price_id order by ae.prod_name
try this.
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
mysql_query("UPDATE Persons SET Age = '36'
WHERE FirstName = 'Peter' AND LastName = 'Griffin'");
mysql_close($con);
?>
ei wait something still wrong... after you changed double qoutes to single qoutes... put a double qoute on after the close parenthesis... here this is the correct syntax.
$sql = mysql_query("INSERT INTO users (user_id, username, user_password, user_regdate) VALUES('hi','$username','$password','beta')");
just changed double quotes(") VALUES("hi","$username","$password","beta") to single qoute(').
your problem is "its just its blank, there's no forms of submit button". u mean u only see a blank page, no form and submit button? If my understanding is right? then this is really a comedy.... the answer is quite obvious... i dont see any code of your html form. what you got here is the php receiving end where the data is to be processed.
window.location='yoourpage.php';
What if your query return an empty recordset?
1st you have to study how to upload. then DBMS add a field in your current database that will hold the source file of the image. and then query the field and view it via <img src=''> tag
how can we help u if u can't show the code
u forget to show the code... well based in your problem i think its because you didn't escaped the singe quotes (') in the sentece. coz. single qoutes has meaning in PHP so they should be escaped. i think this may be your code
<?php echo "10 Facts about World's Tallest Building"; ?>
. you must escape the single quote inside your sentence to something like this.
<?php echo "10 Facts about World\'s Tallest Building"; ?>
yeah i agree with network18, check for the values of $a and $b... the fact that it work fine in phpmyadmin means your query is fine and should satisfy the query statement... if you had the correct values of $a and $b the query will return true.
1st i spot a typo error '$Vet_Middle:' but you said you removed the colon but still the problem exist... I patiently recount your data and there is no problem you had 28 fields in your insert into values.... the last thing that's bugging me that may cause the problem would be storing incorrect data type on a specific field. i mean for ex. if you set the a field to data type int... the value should be inserted would be an integer. Try to review your data.
i dont know if i understand you right... but this is what i understand from your problem... and i come up with this code.
<?php
mysql_connect('localhost','root',''); /* i use the default */
mysql_select_db('yourdatabase'); /* your database */
$sql = mysql_query( "SELECT new_user FROM yourtable WHERE userid='1'" ); /* for this sample i have a new_user field to determine new users, '1' is true. Also for the userid is only a sample id, and you should use session instead */
$row=mysql_fetch_array($sql);
if($row['new_user']==1){ // new user
echo "<input type='checkbox' name='atd' value='atd' /> access to delete<br />
<input type='checkbox' name='ata' value='ata' /> access to add<br />
<input type='checkbox' name='ate' value='ate /> acess to edit<br />
<input type='checkbox' name='atv' value='atv' /> access to view<br />";
}else{
echo "<input type='checkbox' name='atd' value='atd' checked='true' /> access to delete<br />
<input type='checkbox' name='ata' value='ata' checked='true' /> access to add<br />
<input type='checkbox' name='ate' value='ate checked='true' /> acess to edit<br />
<input type='checkbox' name='atv' value='atv' checked='true' /> access to view<br />";
}
?>
<input type='submit' name='btnsubmit' value='submit' />
</form>
here is my algorithm to your problem, just changed the values.
<?php
if(isset($_POST['btnsubmit'])){
$chk = $_POST['chk'];
foreach($chk as $val){
echo $val."<br />";
}
}
?>
<form method='post'>
<?php
while($row=mysql_fetch_array($sql)){
echo "<input type='checkbox' name='chk[]' value='".$row['fields']."' /> ".$row['fields']."<br />";
?>
<input type='submit' name='btnsubmit' value='submit' />
</form>
Many people uses PHP coz. it's free
yesh... thank you for your reply, but ive already fixed the problem, i just replace my wampserver to xampp, thanks to xampp the error doesn't occur anymore. I think the error was caused by some depreciated functions when i migrated to the newer version of wamp.
oh thanks for the replies but ive already solved the problem. I just replace my wampserver with xampp. thanks to xampp the problem was fixed an the error did not occur anymore. By tha way Atli i think your right maybe a depreciated code has triggered the error.
i had problem running my projects on localhost. why does i cant access some of the page? there will be an error that says apache has encountered some serious error and need to be closed. this problem started after i replaced wampserver2.0c to the latest wampserver2.0i. Is there a problem coding from old wampserver then running the project to a new new version. please help. sorry for my poor english
ei could someone help me with my problem. I got error running my projects on localhost. I dont know what caused this, but this problem occured when i replace my wampserver2.0c to the latest version wampserver2.0i. before there is no error it works fine. but now when i logged in and i access my account an error will appear "Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience.". any ideas?
ok guys thanks for your reply
hello guys im a php programmer and im new to homebased programming jobs. I just want to have an idea on how homebased programming job works? how do i find some clients? how to transfer files? how to receive my payments? And they say you are paid per hour? but how can they determine if im working with that hour. Im actually looking for some jobs online... specially homebased. Im hardworking. Sorry for my poor english.
weeeee! yes at last i found problem.... the problem was with my old wampserver2.0e. Its php.ini wont work... so i downloaded the latest version wampserver2.0i and i configure the timezone and it work perfectly. I dont know why wampserver2.0e php.ini doesnt work. thanks to all the people who responed and give their ideas on my problem... tnxs, it means a lot to me.
i tried restarting the server it doesnt work, i tried quoting the value of time zone ex. date.timezone = "America/New_York" still it doesnt work... please help.
Hi everyone....I have a problem on my php date function... and i hope someone will help.... the PHP date function outputs incorrect results... It outputted incorrect date which is 8 hours late.... and i found out that the timezone has been set to UTC. So ive search the net and found out that you can set the timezone by explicitly adding a code date_default_timezone_set('Asia/Manila'); for example coz. im from the Philippines. So i tried the code and it works fine, but when i set date.timezone = Asia/Manila in the php.ini file. It doesnt work... I hope i can find answer here coz. these has been my problem for a long time... any response would be greatly appreciated tnxs :'(
Aha! at last! i found here what ive been searchin for.... tnxs bro your the best!