Shanti C 106 Posting Virtuoso

A.R. Rehman Songs
Indian devotionals...

Shanti C 106 Posting Virtuoso

use explode function..
Assume $_POST is your form textarea name.
see this:

$names = explode(",", $_POST['textareaname']);
print_r($names );
foreach($names as $key=>$value)
{
echo $value;
}
Shanti C 106 Posting Virtuoso

try this:

RewriteRule ^album/(.*)(/?)$ /viewAlbum.php?aid=$1
Shanti C 106 Posting Virtuoso

A mind troubled by doubt can not focus on the course to VICTORY...
- Arthur Golden.

Shanti C 106 Posting Virtuoso

848

Shanti C 106 Posting Virtuoso

use update query to replace that string.
Assume photos is your table and imageurl is your field..
Take backup of your table before update all these..
try this:

update photos set imageurl = replace(imageurl,'http://domain.com/','')

If you dont' want to update in your database..
then try some php string functions str_ireplace() to replace that string in image path..

Shanti C 106 Posting Virtuoso

What data type you have specified for your points field in your database..
post your table structure and your query...

Shanti C 106 Posting Virtuoso

Try this:

RewriteEngine On
RewriteRule ^(.*)$ /index.php?page=$1 [L]

The link in the url will not be changed its self,
you should have to give http://example.com/images instead of http://example.com/index.php?page=images all in your application pages...
So that end user can access with your desired link.

Shanti C 106 Posting Virtuoso

For some reason, it acts like the session variable was not created.

My current output: (domain/index.php?page=portfolio&view=#)
Quote ...

ERROR: NULL VARIABLE

My expected output: (domain/index.php?page=portfolio&view=#)
Quote ...

TEST

First test your session is created or not..
like this:

session_start();
if($_GET['view'] == 0){ // URL would be domain/index.php?page=portfolio&view=0
	$_SESSION['catImages'] = array();
	$_SESSION['catImages'][0] = "TEST";
} else { // URL would be domain/index.php?page=portfolio&view=#
if(isset($_SESSION['catImages']) && !empty($_SESSION['catImages']))	
echo "Session not created";
else
echo $_SESSION['catImages'][0];
}
Shanti C 106 Posting Virtuoso

First , this thread is not at all related to PHP,
and many codes available in google for this..
Just try with some code and come here for suggestions..

the below is the code for disabling a button:

document.myform.mybutton.disabled = true;

Write onclick function for your form checkbox and validate whether this is check or not, if it is checked then disable your button by the above code..

Please make a try on this and come up with your code if it not work..

Happy new year too...

Shanti C 106 Posting Virtuoso

You have to increment session login_counter before redirect to the Main_Login.php page..
see this:

if(!isset($_SESSION['txtusername']))   
{  
session_register("txtusername");   
session_register("txtpassword");  
session_register("login_counter");
$_SESSION['login_counter']=0;   
$_SESSION['txtusername']=""; 
header("location:Main_Dashboard.php");  
}  
else  
{ 
$_SESSION['login_counter']=$_SESSION['login_counter']+1;
header("location:Main_Login.php"); 
  
}  
}

and put this code in Main_Login.php page:

if(isset($_SESSION['login_counter']) && ($_SESSION['login_counter']==3))
    {
       echo "Please wait for some time!";
     }
Shanti C 106 Posting Virtuoso

try this:

if($count==1)
{
if(!isset($_SESSION['txtusername']))
{
   session_register("txtusername");
   session_register("txtpassword");
   session_register("login_counter");
    $_SESSION['login_counter']=0;
   $_SESSION['txtusername']="";// intialize name
   header("location:Main_Dashboard.php");
}
else
{
   $_SESSION['login_counter']=$_SESSION['login_counter']+1;
}
}

and to validate:

if(isset($_SESSION['login_counter']) && ($_SESSION['login_counter']==3))
{
   echo "Please wait for some time!";
}
Shanti C 106 Posting Virtuoso

just intialize a session with username and logincounter like $_SESSION and $_SESSION
for every try increment the logincounter session for the same username..
if its greater than 3 then dont' allow for login..

or post your code, we will check it out..

Shanti C 106 Posting Virtuoso

if($count==1)
{
session_register("txtusername");
session_register("txtpassword");
header("location:Main_Dashboard.php");
}

You have written session_register("txtusername");
But no where assigning value in it like $_SESSION="name";

in logout page:

unset($_SESSION);

where do you defined $_SESSION in your code..

If you got any errors, plz post here...

Shanti C 106 Posting Virtuoso

Try this:

function doOperation()
{
  static $x=0;
  static $y=0;
  static $z=0;
  $y=$x;
  $z=$z+$y;
  echo "X: ".$x."<br>";
  echo "Y: ".$y."<br>";
  echo "Z: ".$z."<br>";
  echo "------<br>";
  $x=$x+10;
}
doOperation();
doOperation();
doOperation();
doOperation();
doOperation();
Shanti C 106 Posting Virtuoso

remove slash after file name which comes from $post–>post_name;

Shanti C 106 Posting Virtuoso

$data is multi-dimensional array..
try to print like this:

print_r($data[0]);
print_r($data[7]);
Shanti C 106 Posting Virtuoso

As i understood,

see this code:

<script type="text/javascript">
function change_send(x)
{
	//alert(x);
	window.href="page2.php?text="+x;
}
</script>
<html>
<p>
<table>
<tr>
<td>
Your full name:</td>
<td>
<input type="text" name="fullname" onChange="change_send(this.value);"></td>
</tr>
</table>
</html>

or come up with clear information.

Shanti C 106 Posting Virtuoso

or
After getting date from calender in dd/mm/yyyy format , change this format to yyyy-mm-dd. it is not so difficult..
and then write it in your sql query.

Shanti C 106 Posting Virtuoso

in which way you have tried if in web browser..
type url like www.yourwebpage.com/pagename

Shanti C 106 Posting Virtuoso

In which folder you uploaded the .htaccess file in webserver.
and what have you written in .htaccess file..

Shanti C 106 Posting Virtuoso

you have to pass $q to the function fetch() not $data..
mysql_fetch_array() function only takes resource returned by mysql_query() function.

or change your fetch() like this:

function fetch($data)
{
   $q = mysql_query($data);
   mysql_fetch_array($q);
}
Shanti C 106 Posting Virtuoso

A ClassNotFoundException means that some where a class that is used in the code is missing.

check for that file..

Shanti C 106 Posting Virtuoso

1.check whether control is going to if or else..Keep echos in two conditions.
2.Try to print

$row

value before if condition.
3.print cookie value after else..
4. also try this setcookie('LoginIdCookie',$LoginId,time()-3600);
5.for logout coding why you are checking the id with database(as it is already done in login code).

Shanti C 106 Posting Virtuoso

thank you

Shanti C 106 Posting Virtuoso

User(fname, lname,email and userid ------primary key{userid} )

Exam( examid, examname,categoriid-------primary Key{examid})

Exam_user(examid, userid------

Exam_category(categoryid, categoryname----prmary key{categoryid})

you can write:

select u.fname,u.lname,u.email,c.categoryname,e.examname from user as u,exam as e,exam user as eu,category as c where u.userid=eu.userid and eu.examid=e.examid and e.categoryid=c.categoryid;

the above is vary basic query, try inner joins to be more specific..
read joins tutorial in google..

Shanti C 106 Posting Virtuoso

try to quote your post values like this:

'".$_POST['a_id']."'

means
your query should like this:

mysql_query("insert into patient_information (ID,admission_ID,patient_ID,guardian_ID,admission_date,admission_time,patient_status,reason_for_status,referred_doctor_ID,referred_doctor_name,assigned_doctor_ID,assigned_doctor_name,department_ID,department_name,ward_ID,ward_no,room_ID,additional_notes) values('NULL','".$_POST['a_id']."',..etc

or try to echo your query like:

$q="insert into ...."; //  your query
echo $q;

see that query and post here

Shanti C 106 Posting Virtuoso

set ag_code field to null in your data base table or try to insert null value for ag_code like:

INSERT INTO auditor_only(ag_title,ag_code) VALUES("awefwefaa","")

And check these type of fields any more in your table and set them for null..

or post your structure of table..

Shanti C 106 Posting Virtuoso

post necessary code we will check it out..

Shanti C 106 Posting Virtuoso

use sessions to do login and logout pages.. and contact display page only for logged in members..

rajesh1158 commented: correctly said +1
Shanti C 106 Posting Virtuoso

your code is perfectly fine...
As per priteas insert these lines:

$submit = isset($_POST["submit"]) ? true : false;
if ($submit)
{
// your code
}

or try to print this:

if($_SERVER['REQUEST_METHOD'] == "POST")
{
print_r($_POST);
}

try once and post the error what exactly you got.

Shanti C 106 Posting Virtuoso

check whether you are using post or get in form tag..

Shanti C 106 Posting Virtuoso

First try to google and start coding.. Then any problem occur come here for suggestions..Not for doing your home work..

try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
function add_val()
{
  ival=document.getElementById('ivalue').value;
  test.testselect.options[test.testselect.options.length]=new Option(ival,ival);
  document.getElementById('ivalue').value="";
}
//-->
</SCRIPT>

<form action="" method="post" name="test">
<br>
<select name="testselect">
<option>One</option>
</select><br>
<br>
<input type="text" name="ivalue" id="ivalue" value="">
<br>
<br>
<input type="button" name="submit" value="submit" onClick="add_val();">
<br>
</form>
</BODY>
</HTML>
Shanti C 106 Posting Virtuoso

can u be little more clear?
have you used blob for your images saving in your database?

or this :

header("Content-type: image/jpeg");
        $im =  imagecreatefromstring(mysql_result($result, 0));
        imagejpeg($im);
        imagedestroy($im);
Shanti C 106 Posting Virtuoso

i think you wrote unnecessary code.. check it once..

Shanti C 106 Posting Virtuoso

Now internet is a friend.
Later its depends on our way(good/bad) of browsing.

Shanti C 106 Posting Virtuoso

kkjay,

use these functions will help you:

//function for image uploading
function image_upload($image_name,$img_size,$img_temp,$path)
{
if($img_size>1) //for uploading image
{

$proimg=substr($image_name,0,strpos($image_name,'.'));
$commonname=time();
$name=substr($image_name,0,strpos($image_name,'.'));
$fullname=$name.$commonname.strstr($image_name,'.');
$real_image=$path.$fullname;
if(!move_uploaded_file($img_temp,$real_image))
{
$real_image="";
}
chmod($real_image,0777);
}
return $real_image;
}

function image_resize($i_old,$i_path,$size1,$size2)
{
$image_attribs = getimagesize($i_old);
if(substr($i_old,-3)=='gif') {
$im_old =imagecreatefromgif($i_old);
} else if(substr($i_old,-3)=='png') {
$im_old =imagecreatefrompng($i_old);
} else {
$im_old =imagecreatefromjpeg($i_old);
}
$width=$image_attribs[0];
$height=$image_attribs[1];
//
$th_max_width4= $size1;
$th_max_height4=$size2;
$ratio4 = ($width > $height) ? $th_max_width4/$image_attribs[0] : $th_max_height4/$image_attribs[1];
$th_width4 = $image_attribs[0] * $ratio4;
$th_height4 = $image_attribs[1] * $ratio4;
$im_new4 = imagecreatetruecolor($th_width4,$th_height4);
imageantialias($im_new4,true);
$th_file_name4= $i_path;
imagecopyresampled($im_new4,$im_old,0,0,0,0,$th_width4,$th_height4, $image_attribs[0], $image_attribs[1]);
if(substr($i_old,-3)=='gif') {
imagegif($im_new4,$th_file_name4,60);
} else if(substr($i_old,-3)=='bmp') {
imagewbmp($im_new4,$th_file_name4,60);
} else if(substr($i_old,-3)=='png') {
imagepng($im_new4,$th_file_name4,60);
} else {
imagejpeg($im_new4,$th_file_name4,60);
}
return $th_file_name4;
//
}

just call these two functions in your for loop by passing required parameters.
call same image_resize() function for large and small images with different size parameters..
i have tested this code. working fine for me.

thanks.

Shanti C 106 Posting Virtuoso

try this:

<?php
$username = $_POST['username'];
$password = $_POST['password'];
if (isset($username,$password))
{
   $connect = mysql_connect ("localhost","root","");
   mysql_select_db("phplogin");
   $query = mysql_query("SELECT * FROM `users` WHERE username ='$username' and password='$password'");
   $numrows=mysql_num_rows($query);
   if ($numrows==0)
   {
  	 die("Incorrect username / password");
   }
}
else
{
	die("please enter username and password");
}

   ?>
Shanti C 106 Posting Virtuoso

try this is working:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!--
var emp = new Array ("Billy", "Jill", "Wolfgang", "Xavier", "Antoinette","John")
var empNum = new Array (78,90,23,12,56,31)

var i = 0

 var empSearch = eval(prompt("Please Enter the ID of the employee you are looking for?"));
smsg="";
emsg="";
for(var i = 0; i < empNum.length; i++)
{
if (empSearch!=null && empSearch!="")
 {

 if (empNum[i] == empSearch)
 {
   smsg="<br> employee number is valid; this employee is " + emp[i] + "<br>";
   break;
 }
 else
 {
 	emsg="employee number is not valid";
 }
  }
   
}

if(smsg!="")
document.write(smsg);
else
document.write(emsg);
//-->
</SCRIPT>


</BODY>
</HTML>
Shanti C 106 Posting Virtuoso

try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!--
var emp = new Array ("Billy", "Jill", "Wolfgang", "Xavier", "Antoinette","John")
var empNum = new Array (78,90,23,12,56,31)
var i = 0
var empSearch = eval(prompt("Please Enter the ID of the employee you are looking for?"));
for(var i = 0; i < empNum.length; i++)
{

 if (empNum[i] == empSearch)
 {
   document.write("<br> employee number is valid; this employee is " + emp[i] + "<br>");
   break;
 }
 else
 {
 	//document.write("employee number is not valid");
 }
}
//-->
</SCRIPT>
</BODY>
</HTML>
Shanti C 106 Posting Virtuoso

2) How to get the path of the window in js?

var path = document.location.pathname;
alert (path);

1) How to refresh a page in jsp even if the javascript is not supported by the browser or if it is disabled?

window.location.reload( false );
Shanti C 106 Posting Virtuoso

how do I resize the array of images so that i can store the 6 large and 6 thumbs in a server/folder and their locations in a database. I'm not very experienced in PHP.

I think this is regardless of array..
Try with your existing code. But name your images with different names (concatinate image name with time and large/small) and save the path in database.

All the best.

Shanti C 106 Posting Virtuoso

or try this :

string stripslashes ( string $str )
Shanti C 106 Posting Virtuoso

try this before inserting:

$answer=addslashes($answer);
Shanti C 106 Posting Virtuoso

No,

onclick="update_value('".$rows['itm_id']."','".$rows['totalInCart']."');"

why because the update button also repeated in for loop. Then no problem occur.
you just alert your values in js function and see if they are correct or not by clicking different update buttons.

i think you should get correct values..

Shanti C 106 Posting Virtuoso

you can get array of form field like this:

$uimages = $_POST['establishment_image'];
foreach( $uimages as $v ) 
{
 // single image
 print $v;
}
Shanti C 106 Posting Virtuoso

Be deaf while hearing negative talks...

Shanti C 106 Posting Virtuoso

like this:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%
  String q = request.getParameter("q");

  //String str = "Loading JSP String from Ajax: Loading......";
  String[] str = {"one","two","three"};
  java.util.Date dt = new java.util.Date();
  for(int i=0; i<str.length; i++){
  out.println(str[i]);
  // Design you table here and assign strings here
out.println("<table><tr><td>......");
  }
Shanti C 106 Posting Virtuoso

write $_GET and $_POST in for loop as you wrote for your cart items.
Then you can get your values like:

for()
{
echo $_POST[txtqty.$i];
echo $_POST[hidden_id.$i];

}

or try solution2 which is easier than previous...

Thanks.

Shanti C 106 Posting Virtuoso

i am not sure, but try this :

<SCRIPT LANGUAGE=javascript> 
{
  var Backlen=history.length;   history.go(-Backlen); 
  window.location.href=page url
}
</SCRIPT>