vaultdweller123 32 Posting Pro

ei dude theres no function or whatsoever that automatically change it's context language... its a tough job... u had to manually code it to translate every context on different language... you can save the data into the database and query them upon changing the language setting.

vaultdweller123 32 Posting Pro

okey lets assume you have a textfield where you would input your value.

<?php 
if(isset($_POST['btnsubmit'])){ 
$val = $_GET['val']; 
echo "<script>window.location='http://www.domain.co.uk/path/".$val."/path/page.php'</script>"; } 
?> 

<form method='get'> <input type='text' name='val' /> 
<input type='submit' name='btnsubmit' value='submit' /> 
</form>

i hope i understand you correctly....

vaultdweller123 32 Posting Pro

Well, ardav is correct so he is completely within his right to make a post :)

you too! hey im just a newbie... and im just sharing what i know a little about php :'(

vaultdweller123 32 Posting Pro

Actually you can - but it means using htaccess files (as mentioned previously) or using a templating engine (e.g. Rain TPL) which stores cached php files of htmls. For everyday use, I really can't see what advantage there is to be gained from using the *.htm(l) extension if you're using server-side code.

hey ardav! you always contradict at my every post! grrr....! :@

vaultdweller123 32 Posting Pro

you know what... i really want to help you.. but the problem is... i dont understand what you want to happen? You want all the process to be done in one file?

vaultdweller123 32 Posting Pro

its very easy here ill give u an example

1.) if your using html form then all you have to do is specify the url of other page you wish to link. All data will be sent automatically in the receiving end as query string and your url may look like this http://www.domain.co.uk/yourpage.php?var1=1&var2=2&var3=3

<form action='yourpage.php' method='get'>
<input type='text' name='var1' value='1' />
<input type='text' name='var2' value='2' />
<input type='text' name='var3' value='3' />
<input type='submit' value='btnsubmit' value='submit' />
</form>

2.) but if you want to redirect

<?php echo "<script>window.location='yourpage.php?var1=1&var2=2&var3=3'</script>"; ?>
vaultdweller123 32 Posting Pro

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.

vaultdweller123 32 Posting Pro

What if your query return an empty recordset?

vaultdweller123 32 Posting Pro

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"; ?>
vaultdweller123 32 Posting Pro

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>
vaultdweller123 32 Posting Pro

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>