Shanti C 106 Posting Virtuoso

hello,

Please describe your question clearly..
or this is what you are searching...

<form name="confirm" method="post">
Do You want to continue to enter  into chat room?<br>
<br />
<input type="radio" name="confirm" value="1"> Yes<br>
<input type="radio" name="confirm" value="2"> No<br>

<input type="submit" value="Submit" onclick="get_radio_value()">
</form>

<script type="text/javascript">
function get_radio_value()
{
var val=0;
for (var i=0; i < document.confirm.confirm.length; i++)
   {
   if (document.confirm.confirm[i].checked)
   {
      	var val=document.confirm.confirm[i].value;
   }
   }
    if(val == 2)
   	window.location="home.php";
	else if(val == 1)
	window.location="chatrooms.php";
	else
	{
		alert("Please Confirm!!");
		return false;
	}
}
</script>

Reply with your queries with clear information..

Shanti C 106 Posting Virtuoso

i think you should have to change your 6th line to this:

if (!$check) {
Shanti C 106 Posting Virtuoso

change this line to:

<a href="javascript:addRow('dataTable');" > add</a>
Shanti C 106 Posting Virtuoso

you can do this by javascript..
try this link.

Shanti C 106 Posting Virtuoso

or try this:
concatenate $i with your text box id or name..

<?php

for ($i=1;$i<10;++$i)
{//currently only one textbox for testing purpose
  echo "<form name='myform' id='myform' method='post'>";
  echo "<input name='da'"$i" type='text' id='da'"$i" value='none'>";
  echo "<a href='javascript:submit_form();' class='add'>Add</a>";
  echo "</form>";
}
?>
<script type="text/javascript">
function submit_form()
{
    document.myform.submit();
}
</script>
Shanti C 106 Posting Virtuoso

yes, javaAddict is right,,,
Here you are getting client machine resolution properties in javascript only, then why you go for JSP coding here,just try with the above post example.
that is the best answer..

Shanti C 106 Posting Virtuoso

the try this:

RewriteRule ^login$ login.php?req=preview&login_name=$1

or

RewriteRule ^([^.]+[^/])$ login.php?req=$1

If this is not your solution , then tel me clearly...

Shanti C 106 Posting Virtuoso

i have tried this..
its worked fine for me...

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
Shanti C 106 Posting Virtuoso

Don't use this statement $row=mysql_fetch_array($result); twice in your code...
Just remove first one , then you will find your expected result...

Shanti C 106 Posting Virtuoso

Here is some expectablel solution not sure...
for example , if you have a quantity field then , if we entered any letters on that it will show an immediate alert "Please Enter Only Numbers (0-9)"
if this is your expected solution . then the following is the code for that...if not post clearly....

<form name="exampleform" method="post" action="">
<input name="qty" type="text"  id="qty" value="" onKeyUp="Only_Num(this.id)" size="3" maxlength="5">
</form>

function:

function Only_Num(id)
{
 if(isNaN(document.getElementById(id).value))
 {
  alert("Please Enter Only Numbers (0-9)..");
  document.getElementById(id).value='';
  document.getElementById(id).focus();
 }
 return;
}
Shanti C 106 Posting Virtuoso

Ok...Welcome....

theimben commented: Thanks :) +2
Shanti C 106 Posting Virtuoso

I think the above is very simple method...
hmmmm...
another method is , you have use session arrays....
But above method.....No need to worry about anything else....

Shanti C 106 Posting Virtuoso

you are right...
then why don't you use swith case in if loop...
then try like this...

if(!empty($_GET['err'])){
    switch($_GET['err']){
        case 'nosearch' : $msg="Your search returned no results - <a href="guide?t=search">Click Here For Search Tips</a> ";
        break;
    .......and so on
    }
}

then you have to pass your url like

?err=nosearch
Shanti C 106 Posting Virtuoso

use this echo $errormessages ['nosearch']; instead of $_GET['nosearch']; If my answer is not reached your question, be more clear...

Shanti C 106 Posting Virtuoso

try like this:

"INSERT INTO `wall` (`user`, `from`, `content`, `date`) VALUES(.............etc.
Shanti C 106 Posting Virtuoso

you forget to put comma after this line:

`title` VARCHAR( 255 ) NULL

that will fix your problem...
very silly, check out all possibilities for errors and finally you shoul post your question here..
k.all the best.

Shanti C 106 Posting Virtuoso

yes..
and also look at query optimization and indexing,if you are using joins and complex query in your page...
Minimize your loop as make as possible..this is better on rather to set a time for infinite...

Shanti C 106 Posting Virtuoso

check this:

echo $qur="INSERT INTO person(pID, firstName, middleName, lastName) VALUES('$pid', '$firstName', '$middleName', '$lastName')"
mysql_query($qur);

copy and paste what it gives out into your database...
or you didn't give password at line 1...

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

try this or post your code...

window.open("","newWin","toolbar=no,location=no,resizable=no,
width=200,height=200,left=100,top=100")
Shanti C 106 Posting Virtuoso

ecommerce
cms based projects

Shanti C 106 Posting Virtuoso

not the matter , the above query is possible or not...if our session time and date matches the database fields , it will give according result...
But we want the desired output from that query...thats why post what you want,table structure and any other variables...then i will look into that...

Shanti C 106 Posting Virtuoso

hello jackakos,
in this line

$get_event = "select * from event where event_time like $_SESSION['event_time'] and emp_no like $_SESSION['check_array']";

it is better to use = while getting data eith emp_no.
and you can use $check_array in your query like:

$get_event = "select * from event where event_time like $_SESSION['event_time'] and emp_no like $check_array";

because we are using foreach..
if my post is wrong...please ignore..

Shanti C 106 Posting Virtuoso

i checked your code...
why are you using checkbox code in echo statement...thats why the problem raises...
use it as html code..
here is update code...that database belongs to my table..please change your database values accordingly...

<? // Make a MySQL Connection
 $conn = mysql_connect("localhost", "root", "1234")
      or die(mysql_error());
   mysql_select_db("iisspl",$conn) or die(mysql_error());

$my_list = "select fname,lname
         from is_users order by lname, fname";
         
$my_list_res = mysql_query($my_list) or die(mysql_error());

if (mysql_num_rows($my_list_res) < 1) {
         //no records
         echo "<p><em>Sorry, no records to select!</em></p>";
         
} else {
	// array that accepts the employee list - shd use $_SESSION???
	$hello_array[] = $my_list_res;
?>
<!-- major table starts here -->

<form name="slip" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" onSubmit="return chkaddad();"> 

<script language="javascript">
function chkaddad()
{
 isChecked1=false
for(var i=0;i<document.forms["slip"]["dname[]"].length;i++){
if(document.forms["slip"]["dname[]"][i].checked){
isChecked1=true
}
}
if(!isChecked1){
alert('Atleast select one check box ..');
return false;
}
 

}
</script>
<table border='1'>
<tr> <th>Last Name, First Name</th> <th>Check / UnCheck </th> </tr>
// keeps getting the next row until there are no more to get
<?php
while($row = mysql_fetch_array( $my_list_res )) {
	// Print out the contents of each row into a table
	
	//echo $row['name'];
	//echo $_SESSION['ids'] = $_POST['eventtime'];
	
	echo $display_name = stripslashes($row['fname']);
	$ids[] = $row['lname'];
	$_SESSION['uid'] = $ids;
	?>
<tr><td><? echo $display_name;?>
	</td><td> 
	
	<input name="dname[]" type="checkbox" value="<?=$row['fname']?>">
	
	</td> </tr> 
	<?
} 
}?>
</table>

</center>
<!-- Cancel and Next Buttons should be placed in a form -->
<br />
<br />

<input type="Submit" name="cancel" value="CANCEL!!!"> &nbsp; &nbsp; &nbsp; &nbsp; 
<input type="submit" name="nex" value="Next"  onClick="return chkaddad();"> 
</form>

<?php


if(isset($_POST['nex'])){
	
		/**
		 *
Shanti C 106 Posting Virtuoso

Can somebody please be of HELP?

Hello jackakos,
post your whole code of that page...i will check it now...

Shanti C 106 Posting Virtuoso

then post your required code......

Shanti C 106 Posting Virtuoso

I think we don't need to pass a variable to an included file, it already has
access to all variables in the including script. It becomes part of the
script that is including it.

$page = 'partner';
include '../admin/addcustomer.php';

Now addcustomer.php will see that $page contains 'partner'.

Shanti C 106 Posting Virtuoso

what is the need to put three forms here...

Shanti C 106 Posting Virtuoso

can you be more clear about it ???????

Shanti C 106 Posting Virtuoso

try this:

foreach($_POST["dname"] as $key=>$val){
  echo "key: ". $key. " value: ". $val ."<br />\n";
Shanti C 106 Posting Virtuoso

yes, in POST variable are stored in a array called $_POST...so we can retrieve them with key like $_POST; or $_POST; or some thing...No matter of order...
or As adilkhan said,try to print print_r($_POST);...

FlashCreations commented: Thanks for the Help!!! +1
Shanti C 106 Posting Virtuoso

your post is not clear for me...
please post again with clear...i am not telling totally wrong..

Shanti C 106 Posting Virtuoso

so,you wan to delete only that post,then simple use:

$query = "DELETE FROM `forumtutorial_posts` WHERE postid = '$parentid'";

i don't know, why you are writing the below line..could you please tel me what is the reason behind that line...

parentid = '$parentid' OR

or if you want to recognize both parentid and postid then use AND instead of OR.

Shanti C 106 Posting Virtuoso

A. I have to validate the selection made

this is the code:

<script type="text/javascript">
function chkChecks(){
isChecked=false
for(var i=0;i<document.forms["new_page"]["allowed[]"].length;i++){
if(document.forms["new_page"]["allowed[]"][i].checked){
isChecked=true
}
}
if(isChecked){
document.forms["new_page"].submit()
}
else{
alert('Please select a checkbox')
}
}
</script>

And

B. I have to store the value of the selected checkboxes into an array

For this:
this single line will get all checked ones with comma sepperated,then you can insert them in your database..

$comma_checkedones = implode(",", $_POST["dname"]);
Shanti C 106 Posting Virtuoso

try this:

var url="check.php"
url=url+"?password="+password 
url=url+"?password_check="+password_check
Shanti C 106 Posting Virtuoso

pass the auto increment id to the delete command..which is unique in your table...
or post table structure ...
and here what are those parentid and postid...
i think postid is your unique id...???

Shanti C 106 Posting Virtuoso

see this:

$variable="a";
$sql = "select * from characters where letters like '%".$variable."%'";
Shanti C 106 Posting Virtuoso

hello try this:

$sql = "select * from characters where letters like '%a%'";
$query = mysql_query($sql);
$count=mysql_num_rows($query);
echo $count;
Shanti C 106 Posting Virtuoso

i think no difference between them....

Shanti C 106 Posting Virtuoso

session_register() registers the global variable with that name in the current session.

- is my assumption correct that every checkbox checked is added to the array only?

yes...only the checked ones are added to that array..
you have to read more about sessions here

Shanti C 106 Posting Virtuoso

see this code...it will print only clicked checkboxes..

foreach($_POST['checkbox'] as $key=>$val){
  echo "key: ". $key. " value: ". $val ."<br />\n";
  echo $_POST['checkbox'][0];

and this is for storing in sessions:

session_start();
 if($_SERVER['REQUEST_METHOD']=='POST')
{
foreach($_POST['checkbox'] as $key=>$val){
  echo "key: ". $key. " value: ". $val ."<br />\n";
  session_register(); 
  //$_SESSION['checked'] = array();
  
 
}
$_SESSION['checked']=$_POST['checkbox'];
 foreach ($_SESSION['checked'] as $key=>$value) {
     echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' <br />';

     }
}
OmniX commented: Nice coded comment. Thankyou. +1
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

hello..
that is CAPTCHA ..means creating dynamic number on an image...
It is used to prevent spam abuse on the websites
For more information:
http://www.webcheatsheet.com/PHP/create_captcha_protection.php

OmniX commented: Very useful and informative information. +1
Shanti C 106 Posting Virtuoso

hello see this code:
it will print 200 as 200.00

<script language="javascript">
function CurrencyFormatted(amount)
{
      var i = parseFloat(amount);
      if(isNaN(i)) { i = 0.00; }
      var minus = '';
      if(i < 0) { minus = '-'; }
      i = Math.abs(i);
      i = parseInt((i + .005) * 100);
      i = i / 100;
      s = new String(i);
      if(s.indexOf('.') < 0) { s += '.00'; }
      if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
      s = minus + s;
    // alert(s);
    return s;
}
</script>
Shanti C 106 Posting Virtuoso

did your problem got solved???
Indian.....AndraPradesh..

Shanti C 106 Posting Virtuoso

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.
means...
ob_start() just turns on output buffering. It means the web server doesn't start sending output to the browser until the page is complete and it's a big performance enhancer.

Shanti C 106 Posting Virtuoso

use session_start only once..
means use at your page which is having the above code which you have posted above..
remove session_start(); line from your function.php page..
and also use ob_start(); after your session_start(); line....

Shanti C 106 Posting Virtuoso

and also try these lines and tel me what you got there:

echo $r="SELECT * FROM `accounts` WHERE `name` = '" . $username . "'";
	$result = mysql_query($r);
Shanti C 106 Posting Virtuoso

This page covers the .do extension pretty well. It's a Java/Struts/JSP thing.

Shanti C 106 Posting Virtuoso

desc is a keyword,
so change that name to any like desc1...
and try...

rickya100 commented: Thanks for the quick reply. Solved +1