hielo 65 Veteran Poster

Do you actually see the message "Your password has been changed..."? If yes, then try adding a "To" header as well:

...
		if (mysqli_affected_rows($dbc) == 1) { // If it ran OK.
		        $headers="";
		        $headers.="From: northherner@hotmail.com".PHP_EOL;
		        $headers.="To: ".$_POST['email'].PHP_EOL;

			// Send an email:
			$body = "Your password to log into <whatever site> has been temporarily changed to '$p'. Please log in using that password and this email address. Then you may change your password to something more familiar.";
			mail($_POST['email'], 'Your temporary password.', $body, $headers);
			
			// Print a message and wrap up:
			echo '<h3>Your password has been changed.</h3><p>You will receive the new, temporary password via email. Once you have logged in with this new password, you may change it by clicking on the "Change Password" link.</p>';
			include ('./includes/footer.html');
			exit(); // Stop the script.
			
		}
...
hielo 65 Veteran Poster

pleaset tell me specially about word entirely.

read the comment on line 10 again of that post again. It clearly states "think equals"

So if you had:

var str="abc123def";

Does that str "equals"/"consists entirely of" a string that is made up of digits only? No

//By contrast, this would be true:
var str="530";
var re=/^[0-9]+$/;
alert( re.test(strA) );

/* notice that str is made up of all digits.  It doesn't matter which digits or in which order.  All that the regex above cares about is that str consists only of digits. */
hielo 65 Veteran Poster

OK, then if you don't understand my post, change your code as follows:

print '<select name="day">';
for ($day = 1; $day <= 31; $day++) 
{
  if($datearray[2]!=$day)
    print "\n<option value=\"$day\">$day</option>";
  else
    print "\n<option value=\"$day\" selected=\"selected\">$day</option>";

}
print '</select>';
hielo 65 Veteran Poster
hielo 65 Veteran Poster

try:

<?php
$datearray=explode('-','1980-09-28');

$days=str_replace('>'.$datearray[2],' selected="selected">'.$datearray[2],preg_replace('#option>(\d+)#','option value="$1">$1','<option>'.implode('</option><option>',range(1,31)).'</option>'));
echo '<select name="day">'.$days.'</select>';
?>
hielo 65 Veteran Poster

if you had:

var strA="abc123def";
var strB="123";

/* then the following would be used to check if str "contains" one or more consecutive digits */
var re=/[0-9]+/;

alert( re.test(strA) );//true - strA contains digits
alert( re.test(strB) );//true - strA contains digits

/* however, the following checks to see if it "consists entirely" (think "equals") of digits */
var re=/^[0-9]+$/;
alert( re.test(strA) );//false - strA does NOT consist entirely of digits
alert( re.test(strB)  );//true - strA consists entirely of digits


/* this one would be for a string that "ends" in digits (regardless of what is at the beginning) */
var re=/[0-9]+$/

/* this one would be for a string that "starts" with digits (regardless of what is at the end) */
var re=/^[0-9]+/

Look for online tutorials on regexs. It will be more productive for you if you first read up a "formal" regex tutorial.

hielo 65 Veteran Poster

The whole expression makes sure that the input value
starts (^)
and ends ($)
with one or more (+)
upper or lower case letter ([a-zA-Z])

hielo 65 Veteran Poster

try:

function checkpostal(){
  var re=/^[a-zA-Z]+$/; 
  var result=re.test(myform.myinput.value);
  if( result )
  { 
    alert("Good")
  }else{
    alert("Bad")
  }
return result;
}
hielo 65 Veteran Poster

If you are trying to create multiple "sets" of dropdowns, make sure you give all your selects unique ids and call the function with the corresponding ids -ex:

onload=function(){
	 populatedropdown('d1', 'm1', 'y1')
	 populatedropdown('d2', 'm2', 'y2')
};
</script>
<div>
<select id='m1' name='month'></select>
<select id='d1' name='day'></select>
<select id='y1' name='year'></select>
</div>
<div>
<select id='m2' name='month'></select>
<select id='d2' name='day'></select>
<select id='y2' name='year'></select>
</div>
hielo 65 Veteran Poster

Read comments in code:

Dim strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS   = Server.CreateObject("ADODB.Recordset")
objConn.ConnectionString = "Provider={SQL Server};Server=server;Database=db;User ID=id;Pwd=pw"

strSQL = "SELECT * FROM table"

'open connection first
objConn.open

'execute the sql on the Recordset object
objRS.Open strSQL, objConn, 1,3

If Not objRS.EOF Then
 'iterate through records here
Else
 'no records found
End If
objRS.close
Set objRS=Nothing
objConn.close
Set objConn=Nothing
hielo 65 Veteran Poster

FYI: $x->item($i) is a DOMNode object. Be sure to read the manual on the DOMNode to see what properties it supports:
http://www.php.net/manual/en/class.domnode.php

After you have read at least the properties of the DOMNode, read the comments in the code and notice how I've used the properties of the DOMNode to reference the node values that you want. Within the loop, uncomment the line that you want to try:

$x=$xmlDoc->getElementsByTagName('ARTIST');

for($i=0,$limit=$x->length; $i<$limit; ++$i)
{
	//this $n is just to have a convenient shortcut in the code that follows
	$n=$x->item($i);

	if( $n->nodeValue==$q )
	{
		//this will give you the COUNTRY node regardless of the order 
		//in which it appears within the CD tag. You can of course use
		//the same code/line for other tags, not just COUNTRY. This is
		//convenient when someone else will be maintaining/providing 
		//the xml and you don't know for sure they'll be providing the
		//the nodes in the specific order in which you expect them
		//echo $n->parentNode->getElementsByTagName('COUNTRY')->item(0)->nodeValue;
		
		//The lines that follow show you how to achieve what you are after
		//but unlike the example above, they are dependent on a specific
		//order of the nodes.

		//This will give you the COUNTRY node only when it appears
		//immediately after the ARTIST node within the CD tag
		//echo $n->nextSibling->nodeValue;

		//you can chain nextSibling to get to other nodes located 
		//AFTER COUNTRY
		//ex:
		//to get COMPANY
		//echo $n->nextSibling->nextSibling->nodeValue;
		//
		//to get PRICE
		//echo $n->nextSibling->nextSibling->nextSibling->nodeValue;
	}
}

On another note, if you want to make the search case-insensitive …

hielo 65 Veteran Poster

first of all on your post above, &pic = $row['pic']; should be $pic = $row['pic']; .

From that post, I can see that $expdat is derived from the value you have in the `pic` column of your `stk` table. So you need to show where you are updating `stk`.`pic` . What you posted shows where you are updating `stk`.`dclaim` , but that is NOT the problem. Look through your code and see where you are updating `stk`.`pic` and then post it here.

hielo 65 Veteran Poster

if you are going to use mysql_real_escape_string() , then stripslahses() first since magic_quotes are enabled - ex:

$search = "q test'yes";
$search = mysql_real_escape_string( stripslashes($search) );
mysql_query("SELECT * FROM block WHERE name LIKE '%$search%' ORDER BY `id` DESC",$this->connect);
hielo 65 Veteran Poster

try:

$sql = mysql_query("UPDATE joke SET joketext='$text' WHERE id='$id'") or die( mysql_error() );

notice the apostrophes around the value of $id

hielo 65 Veteran Poster

try:

$result_1= mysqli_query($link, "SELECT $criteria FROM table ORDER BY $crieria ASC") or die( mysqli_error($link) );
hielo 65 Veteran Poster
//connect to db first
...
$expdat='July 20, 2012';
$theValue='<span style="background-color:yellow">Expires ' . $expdat . '. </span>';

//escape the value you are about to insert into the table:
$theValue = mysql_real_escape_string($theValue);

//provide the correct name for your table and your field
mysql_query( "INSERT INTO `tableName`(`fieldName`) VALUES('" . $theValue . "')" ) or die( mysql_error() );

//now if you select the inserted value you should be able to get what you inserted.
...
hielo 65 Veteran Poster

I think you meant nextSibling() , not next_sibling() :
http://www.php.net/manual/en/class.domnode.php

hielo 65 Veteran Poster
...
<a href="http://{target}"><xsl:value-of select="name" /></a><br />
...
hielo 65 Veteran Poster

I was not able to locate loadxmldoc.js, but try:

<script type="text/javascript">
xmlDoc=loadXMLDoc("file:///E:/TEST/testrun/test_1.xml");
 
w=xmlDoc.getElementsByTagName("context");
//y=xmlDoc.getElementsByTagName('start');
//x=xmlDoc.getElementsByTagName('end');

for (var i=10;i<w.length;i++)
{
	var y=w[i].getElementsByTagName('start')[0];
	var x=w[i].getElementsByTagName('end')[0];
	var att=w.item(i).attributes.getNamedItem("id");
	document.write(att.value);
	document.write(" | ");
	//document.write(y[i].childNodes[0].nodeValue);
	document.write(y.childNodes[0].nodeValue);
	document.write(" | ");
	//document.write(x[i].childNodes[0].nodeValue);
	document.write(x.childNodes[0].nodeValue);
	document.write("<br />");
}
</script>
hielo 65 Veteran Poster

I am making everything in the parenthesis optional - including the colon. You on the other hand were making the colon required. Also, \w is shorthand for all the characters that you have within the bracket.

hielo 65 Veteran Poster

rename Member_Library_Trial.html to Member_Library_Trial.php

AND also change: <?php $_SESSION['name']?> to: <?php echo $_SESSION['name'];?>

hielo 65 Veteran Poster

>>I was able to do some of this
Using what exactly VBSCRIPT, PHP, XSL? Post what you have thus far.

hielo 65 Veteran Poster

if $email equals 'joe@gmail.com' and $level equals 1, Then if you are TRYING to set: $_SESSION['joe@gmail.com.1']='...' , then the above will not work. You need to use DOUBLE quotes so that the variables are evaluated: $_SESSION["$email.$level"] Perhaps what you are after is something like:

$_SESSION['email_level']=$email.PHP_EOL.$level;

Then later on if you need those values, you explode() on the PHP_EOL character:
list($email,$level)=explode(PHP_EOL, $_SESSION['email_level']);
echo 'Email',$email,'<br />';
echo 'Level',$level,'<br />';
hielo 65 Veteran Poster
{tour([:]\w+)?}
hielo 65 Veteran Poster

When we copy $url value in url its working

That tells me that the remote script works with a GET request. On your post, comment out lines 12 AND 13. You are really NOT POSTing anything, since:
a. $curlPost is not defined anywhere in that function
b. again, based on your last comment, the script works with GET not POST

hielo 65 Veteran Poster

That is not working dude

You need to be more descriptive. Imagine calling your doctor and saying "I am not feeling well. Please write me a prescription"

The only thing that stands out from your original post is: text.innerHTML = "hide"; I don't see where you defined "text". Did you perhaps mean ele.innerHTML="hide";

hielo 65 Veteran Poster
Part
   id autonumber
   name varchar

Supplier
   id autonumber
   name varchar

SupplierPart
   Supplier_id  int
   Part_id      int
   quantity     int
hielo 65 Veteran Poster

change: $mark = mysql_query("select * from product order by product_id DESC"); to: $mark = mysql_query("select * from product order by product_id DESC") or die( mysql_error() ); It should tell you WHY the query is failing.

hielo 65 Veteran Poster

toggle(this)

this IS the <a> tag so you do NOT need:
var ele = document.getElementById(int);

all you need is:

<script language="javascript">
//function toggle(int) {
//var ele = document.getElementById(int);
function toggle(ele){
  if(ele.style.display == "block") {
  ele.style.display = "inline";
}
else {
ele.style.display = "block";
text.innerHTML = "hide";
}
} 
</script>
hielo 65 Veteran Poster

are you having trouble sending/submitting all the fields? If so, try:

$('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$("#message").slideUp(750,function() {
		$('#message').hide();			
		
		// http://api.jquery.com/serialize/
		$.post(action, $('#contactform').serialize(),
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#contactform img.loader').fadeOut('fast',function(){$(this).remove()}); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
hielo 65 Veteran Poster

Which protocol?

http:// (I even hightlighted it for you. Basically what you have in line 6 is incomplete).

hielo 65 Veteran Poster

well, I see three function calls bolded, but what you need to do is call just ONE function and from that function you do your first ajax call. On that first ajax call, you should have a callback function - the function that executes upon completion of the ajax request. WITHIN THAT callback function call your other ajax function - ex:

<script>
function clickHandler(cb){
  disablebatch(); 
  //assuming that the following two are making the ajax calls
  //then calling these sequentially will still give you problems
  //  selectinactivecourse(cb.checked); 
  //  allbatches(cb.value);
  //
  //instead call the first one, passing the checkbox reference
  //(intead of just true/false):
  selectinactivecourse(cb); 
}

function selectinactivecourse(checkBox)
{
  //here you checkBox.checked will evaluate to true or false
  //depending on the state of the checkbox. So by passing the reference
  //to the checkbox you still can get the needed info you had previously
  var isChecked=checkBox.checked;

   //doyour ajax stuff
   xhr=...;
 
  //here you have your anonymous callback function
  xhr.onreadystatechange=function(){
     if( xhr.readyState==4)
     {
        allbatches(checkBox.value);
     }
   };

  xhr.send(...);
}
</script>
<input type="checkbox" value="<?php if(isset($_POST['inactive_check'])) echo $_POST['inactive_check']; ?>" onclick="clickHandler(this)" id="inactive_check" name="inactive_check" <?php if(isset($_POST['inactive_check'])) echo "checked";?>></div><div style=" float:left; padding-top:2px; padding-left:5px;">
hielo 65 Veteran Poster

provid the protocol in the url as well: $url="[B]http://[/B]abksms.com...";

hielo 65 Veteran Poster
function toSeconds($str){
  $str=explode(':',$str);
  switch( count($str) )
  {
    case 2: return $str[0]*60 + $str[1];
    case 3: return $str[0]*3600 + $str[1]*60 + $str[2];
  }
return 0;
}

echo( toSeconds("2:15") );//mm:ss
echo( toSeconds("1:00:15") );//hh:mm:ss
hielo 65 Veteran Poster
function toSeconds(str){
  str=str.split(':');
  switch( str.length )
  {
    case 2: return str[0]*60 + str[1]*1;
    case 3: return str[0]*3600 + str[1]*60 + str[2]*1;
  }
}

alert( toSeconds("2:15") )
hielo 65 Veteran Poster

Point the link to the XML file (not the XSL).
The top of the XML should look SIMILAR to the following (you need to provide the correct path to your file): <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="Catalog.xsl"?> Also, at the top of the XSL file make sure you declare the xsl namespace: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

hielo 65 Veteran Poster

it seems taht you are dealing with cached pages. Instead of: ...open("GET", rssfeed, true) use: ...open("GET", rssfeed+"?cb="+(new Date()).valueOf(), true)

hielo 65 Veteran Poster

NOTE: In most of these replies change: name LIKE '$%term%' to: name LIKE '%$term%'

hielo 65 Veteran Poster

<div style="padding-bottom:20px; font-size:small; padding-right:28px; ">Description:<?php echo '<div style="white-space:pre; width:200px;">' . htmlentities($row['description'],ENT_QUOTES) . '</div>';?></div>

hielo 65 Veteran Poster

since you seem to be passing very minimal data, try setting some cookies instead of passing the data via url. Then on the server retrieve the data from the cookies.

In "The Scripts" section of http://www.quirksmode.org/js/cookies.html you will find three very useful functions. Save them as cookies.js and import them into your page. Then use them to create a cookie for each of the data you want to "pass" to the server.

The drawback is of course that the user will require to have cookies enabled.

hielo 65 Veteran Poster

this will display me all the amount field from 26th date till 29th and if i want to add that all amount display how would i perform that..i would use sum function instead the while loop

if you want every record AND the sum, then initialize a $total=0; variable outside the while. Then within the while put $total+=$r['amount']; . After the while, $total should have the sum.

If all you want/need is the sum, then do a SUM query.

hielo 65 Veteran Poster

try creating a different http object for each request. If you are still having problems, post your code.

hielo 65 Veteran Poster

try:

content.value = content.value.substring(0,content.selectionStart) + url + content.value.substring(content.selectionEnd);
hielo 65 Veteran Poster

the table markup you are emitting is not correct. Also, there's no need to save it onto $new .
Try:

$sql=mysql_query("SELECT * FROM `expense` WHERE `date` BETWEEN '2011-04-26' AND '2011-04-29'");


echo '<center><table bordercolor="#000000" border="3" >';

while( $r=mysql_fetch_assoc($sql) )
{
	
  echo '<tr><td>' . implode(' ',$r) . '</td></tr>';

}

echo '</table></center>';
hielo 65 Veteran Poster

you need to iterate over the entire result set:

...
$sql=mysql_query("SELECT * FROM `expense` WHERE `date` BETWEEN '2011-04-26' AND '2011-04-28'")
 
 or die(mysql_error());

while( $r=mysql_fetch_assoc($sql) )
 echo implode(' ',$r).'<br/>';
}
hielo 65 Veteran Poster

why i am getting this array

Because that's what print_r() does.

can't i get it without array

echo/print them individually - ex: echo $r['rec_no'] . ' ' . $r['date'].'<br>'; Or for all of them (without Array): echo implode(' ', $r).'<br>';

hielo 65 Veteran Poster

assuming the field you inserted the data into is named info, then instead of something like: echo $row['info']; try: echo '<div style="white-space:pre">' . htmlentities($row['info'],ENT_QUOTES) . '</div>'; OR: echo '<pre>' . htmlentities($row['info'],ENT_QUOTES) . '</pre>';

hielo 65 Veteran Poster

On another note,

...if($stmt==-1) {...

when will that be true? prepare() and execute() methods return FALSE upon failure. If you are relying on FALSE to be defined as -1, that may not be a good idea. I suggest you consider revising that statement.

Regards,
Hielo

hielo 65 Veteran Poster

Have you tried using REQUEST_URI instead of REQUEST_FILENAME ?

Try:

RewriteEngine On
RewriteBase /~jn/
RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^([^\.]+)/?$ /~jn/$1.php [NC,L]
hielo 65 Veteran Poster
$sql=mysql_query("SELECT * FROM `expense` WHERE `date` BETWEEN '2011-04-26' AND '2011-04-28'") or die(mysql_error());

$r=mysql_fetch_assoc($sql);

//SELECT * ... assuming that the * includes some field named `id`, then the following
//will print it's contents:
echo $r['id'];


//if you want to see everything at once, use:
print_r($r);