vibhaJ 126 Master Poster

nd if thread subscriptions are turned on, you'll be notified by em

Okay.. Thanks for reply.
Also the page containing list of thread where i have posted is also in queue?

vibhaJ 126 Master Poster

Hi All,

Sorry if this question is already asked.
After new changes i am not able to judge that if anyone has posted to the thread after me where i have posted.
Previously judgement was easy based on circle infront of post title.
Now circle remains white bordered even there is some coments after me.
If anybody knows please let me know.

Thanks,
Vibha

vibhaJ 126 Master Poster

Try this:

<?
     while($row = mysql_fetch_array($result)) 
     {
        $one['id'] = $row['id'];
        $one['name'] = $row['name'];
        $one['link'] = $row['link'];
        $one['parent'] = $row['parent'];
        $thisArray[] = $one;
     }
     echo '<pre>';
     print_r($thisArray);

?>
Biiim commented: exact array +5
vibhaJ 126 Master Poster

After urldecode you can use extract function, which will create variable based on array variable.

<?
    $myArray['TIMESTAMP'] = '2012%2d05%2d01T17%3a19%3a07Z';
    $myArray['L_LONGMESSAGE0'] = 'This%20transaction%20cannot%20be%20processed';
    $myArray['CURRENCYCODE'] = 'Euro';
    $myArrayFinal = array_map('rawurldecode',$myArray);

    extract($myArrayFinal);

    echo 'Time: '.$TIMESTAMP;
    echo 'Long Message: '.$L_LONGMESSAGE0;
    echo 'Currency: '.$CURRENCYCODE;
?>

This%20transaction%20cannot%20be%20processed

vibhaJ 126 Master Poster

Your query is bit not clear.
Do you want to save all 3 language names into one array.
If user select any language then set selected language in cookie.
when page is loaded check cookie value and based on that fetch content..
Is that so??

vibhaJ 126 Master Poster

try to change admin rule with :

RewriteCond %{REQUEST_URI} !/admin

Check if it is working or not?

ck direct access to

vibhaJ 126 Master Poster

Make sure any tag doesn't break.
Try below code i have used photourl as image src.

<div class="body2">
  <div class="main">
    <section id="content">
      <div class="wrapper">
        <article class="col1">
          <div id="slider">
            <?php
                while($row=mysql_fetch_array($result))
                {
                ?>
                <img src="<?php echo $row['photourl'] ?>" alt="" title="<strong><?php echo $row['address'] ?></strong><span> <?php echo $row['bathroom'] . " bathrooms," .  $row['bedroom'] . " bedrooms"?> Price: <?php echo $row['price'] ?>     <a href='view-prop.php?address=<?php echo $row['address'] ?>'>Read more</a></span>">
                <?php
                }
                ?>
          </div>
        </article>
      </div>
    </section>
  </div>
</div>
vibhaJ 126 Master Poster

How do you insert data? Using mysql_query function or any mysql interface like phpmyadmin?

vibhaJ 126 Master Poster

PHP is having good function ctype_alnum, which will do all stuff for you in one line.

<?php
$username = 'testing123';
if(ctype_alnum($username))
{
    echo 'Username is valid';
}
else
{
    echo 'Username is not valid';
}
?>
vibhaJ 126 Master Poster

Apart from readymade script, if you still want to make your own code:
1) Design database tables.
e.g
autoId
chatSession
fromUserId
toUserId
message
dateTime

2) There will be one div and one text area for design view.
3) When user type something in textarea and press enter trigger javascript and call ajax to insert textarea's value in database.
make sure you use proper fromUserId and toUserId to insert in database.
4) In div after every 2 sec, call ajax and if there is any new entry in database based on chatSession then show it in div.

vibhaJ 126 Master Poster

http://www.daniweb.com/web-development/databases/mysql/threads/126510/copying-rows-from-one-table-to-another

Just to ask, What is the requirement for moving same data to another table?

vibhaJ 126 Master Poster

I am adding code in post, and clicking on reply button. Codes are not highlighted.
I thought i don't know how to use code tag but when i refreshed page it shows highlighting.
Sorry if this post is repeated question.
Also sometimes i need to delete last post.. Will it be posible in new edition?

vibhaJ 126 Master Poster

Delete it..

vibhaJ 126 Master Poster

It meanse you don't have offers.php in admin folder. Or form action path you have specified is not correct.

vibhaJ 126 Master Poster

Try below.

$query="SELECT admission_no FROM student_info WHERE student_info.admission_no='$admission_no'";
$result=mysql_query($query);
$num_rows = mysql_num_rows($result);
if($num_rows > 0)
{
    // admission no already exist in system 
}
else
{
    // admission no not exist
}
vibhaJ 126 Master Poster

PHP is server side language while javascript is client side. You can not combine both.
If you want to use php functionality in javascript you can use ajax which will send js data to php and will return with php output.

What is your exact requirement so that i can give proper solution.

vibhaJ 126 Master Poster

I don't understand why you have used iframe for image?

I think below html will work for your design.

<form method="post" name="mainForm" id="mainForm">
<table width="500" border="0" cellpadding="0">
  <tr>
    <td width="21%" align="right" valign="top"><input type="radio" name="selected_option" id="rb1" value="one"></td>
    <td width="79%" align="left"><input type="image" name="imageField1" id="imageField1" src="img1.png"></td>
  </tr>
  <tr>
    <td align="right" valign="top"><input type="radio" name="selected_option" id="rb2" value="two"></td>
    <td align="left"><input type="image" name="imageField2" id="imageField2" src="img2.png"></td>
  </tr>
  <tr>
    <td align="right" valign="top"> </td>
    <td align="left"><input type="submit" name="button" id="button" value="Submit"></td>
  </tr>
</table>
</form>

You can also add file input field in form tag to add functionality of file upload.
check this link for more info. http://www.w3schools.com/php/php_file_upload.asp

vibhaJ 126 Master Poster
<div align="center" id="footer"><hr class="footerhr" align="center" />
<p>
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/cityoflosangeles.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/losangelesregionalfoodbank.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/salvationarmy.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/unitedway.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/211.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/fcbc.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/catholiccharities.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/countyoflosangeles.jpg" /><br />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/csbc.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/operationhope.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2012/02/Volunteer-Center-of-LA-113.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/publichealth.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/lutheransocialservices.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2011/07/redcross.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2012/01/L.A.-Works.jpg" />
<img width="50" height="50" src="http://enla.org/wp-content/uploads/2012/01/noahswish-logo-373-336-pixels-2.jpg" />
<img width="50" height="50" src="http://enla.org/wp-
content/uploads/2011/12/tzu-chi.jpg" />

</p>

<p>
        2012 Emergency Network of Los Angeles
        </p>
<hr />


</div>
vibhaJ 126 Master Poster

have you checked this link ?

vibhaJ 126 Master Poster

Make thread solved..

vibhaJ 126 Master Poster

check innerHTML function of javascript.

vibhaJ 126 Master Poster

Or before <center><font color="white" size=5>, add this line.

<br style="clear: both;">
vibhaJ 126 Master Poster

siina,
1) firstly you need to take all html content from site url using file_get_contents.
2) Then find all image tags from html source using preg_match_all.
3) have a loop of images array and again use file_get_contents function to grab image source and save it in your folder.

vibhaJ 126 Master Poster
if (isset($_POST['submit'])) // when form is submitted
{
 
    if($_SESSION['item']==$_POST['h1']) // if "h1" input's value is same as item stored in session (2*: see below)
    {
    	$_SESSION['qty'] = $_SESSION['qty'] + 1; // then increament qty stored in session
    }
    else // if h1's value is not matching with session (1*: see below)
    {
    	$_SESSION['item'] = $_POST['h1']; // then save "h1"'s value in item session
    	$_SESSION['price']= $_POST['h2']; // save "h2"'s value in price session
    }
    // below is setting session array
    $_SESSION['itemname'][$_SESSION['item']] = $_SESSION['item'];
    $_SESSION['itemqty'][$_SESSION['item']] = $_SESSION['qty'];
    $_SESSION['itemprice'][$_SESSION['item']] = $_SESSION['price'];
     
}

If this is related to cart then below is the meaning:
1*: if you are first time adding product to cart then it will create session
2*: if item is already in cart then increament item's quantity.

vibhaJ 126 Master Poster

Normally there are two used of functions.
1) Just call function abstractly, and you don't need anything from function.
e.g.

function echoSum($a,$b)
{
	$c = ($a+$b);
	echo "Sum is :".$c;
}
//==== some php code =====
echoSum($a,$b) // function output is not required further
//==== some php code =====

Here you are just adding both values and echo it in function.
in your further code you are not bothered about function result.

2) Call function and you want to use outcome of function in further code.
e.g.

function getSum($a,$b)
{
	$c = ($a+$b);
	return $c;
}
//==== some php code =====
$sum = getSum($a,$b);
$sum10 = $sum + 10; // use function output further
echo "Sum is :".$sum ." & Sum10 is :".$sum10;
//==== some php code =====

Here you are again adding two values but in further code you want to use outcome of function.
Your next code will depend on function result or output.

Thus you can use return in second case.

vibhaJ 126 Master Poster

You have passed "id" variable in list_user.php
delete_user.php?id=<?php echo $row;?>

And you are using "User_Id" to get its value in delete_user.php.
So replace below line

$User_id = $_GET['User_id'];

with

$User_id = $_GET['id'];
vibhaJ 126 Master Poster

I din't find delete link on update_user.php.
If you are deleting through URL like delete_user.php?User_id=<?php echo $id ?> then it will work or post your code where you have delete link.

vibhaJ 126 Master Poster

of-course $User_id is needed.
I said $User_id = $_POST; should be $User_id = $_POST;.
In form you have all fields which will be posted when you click on submit. But there is no field called User_id so you want get it in posted value.
Add below code in form so User_id will be posted after submission.

<input type="hidden" name="User_id" value="<?php echo $ref1; ?>" />
vibhaJ 126 Master Poster

I think you are passing null to "GetSQLValueString" function.
Debug your code. Add below form when form is submitted. Which will show all form posted variable.

echo '<pre>';
print_r($_POST);
exit;
vibhaJ 126 Master Poster

Is thread solved?

vibhaJ 126 Master Poster

mark thread solved.. if it is.

vibhaJ 126 Master Poster

You can not use $ after bracker.
$_GET; should be $_GET;
Are you sure you are getting $User_id ??
Also as i said in previous page you need to define all variable before using it in update query as shown below.

<?php

if (isset($_POST['submit'])){
//if (isset($_POST['User_level'])){

$link = mysql_connect("localhost","root","root") or die ("Could not connect to the Database Server!");
$db = mysql_select_db("pqs", $link) or die ("Could not select Database!");
$User_id = $_GET['User_id'];
$User_tcno = $_POST['User_tcno'];
$User_name = $_POST['User_name'];
$User_dep = $_POST['User_dep'];
$User_username = $_POST['User_username'];
$User_password = $_POST['User_password'];
$User_level = $_POST['User_level'];
$result = mysql_query("UPDATE userdb SET User_tcno = '$User_tcno', User_name = '$User_name', User_dep = '$User_dep', User_username = '$User_username', User_password = '$User_password', User_level = '$User_level' WHERE User_id = '$User_id'");
}

if($result){
                                                                                
echo "<script type='text/javascript'>window.location='index.php?page=list_user.php'</script>";
}


mysql_close($link);
?>
vibhaJ 126 Master Poster

what is below code ?

$f = function ($d)


// f)
$g = function ($d)
		{
		$e++;
		}

What you want to do with this lines?

vibhaJ 126 Master Poster

Don't use $_POST for file input field.
You need to use $_FILES for file name. and store that name in database.
When you want to display image fetch filename from database and concate with $target_path.
e.g. <img src="<?php echo $target_path.$file_name;?>" />

vibhaJ 126 Master Poster

Where is $User_id defined in update_user1.php?
Also you need to assign all form's posted variables.
e.g.
$User_tcno = $_POST;
Then only you can use $User_tcno in update query.

vibhaJ 126 Master Poster

I am using jqPrint from here : http://plugins.jquery.com/project/jqPrint
Demo will not work but download file and try it.
You just need to use any selector. i.g. div id.

vibhaJ 126 Master Poster

What are the functions you are using before inserting data in mysql?
Are you using add_slashes?

vibhaJ 126 Master Poster

1) If code_block.php is in parent folder then only use include('../code_block.php') if both files are at same folder then use include('code_block.php')
2) You need to create $code_block variable in code_block.php in order to use it in page.php

<? $code_block = 'html html...
    but here i need an include
    html html...
    and here i need an include
    html html...';
    ?>
vibhaJ 126 Master Poster

I have created this function.
You can use it or customize it as per requirement.

<?
	function dateDifference($date1, $date2)
	{		
		$date1=strtotime($date1);
		$date2=strtotime($date2); 
		$diff = abs($date1 - $date2);
		
		$day = $diff/(60*60*24); // in day
		$dayFix = floor($day);
		$dayPen = $day - $dayFix;
		if($dayPen > 0)
		{
			$hour = $dayPen*(24); // in hour (1 day = 24 hour)
			$hourFix = floor($hour);
			$hourPen = $hour - $hourFix;
			if($hourPen > 0)
			{
				$min = $hourPen*(60); // in hour (1 hour = 60 min)
				$minFix = floor($min);
				$minPen = $min - $minFix;
				if($minPen > 0)
				{
					$sec = $minPen*(60); // in sec (1 min = 60 sec)
					$secFix = floor($sec);
				}
			}
		}
		$str = "";
		if($dayFix > 0)
			$str.= $dayFix." day ";
		if($hourFix > 0)
			$str.= $hourFix." hour ";
		if($minFix > 0)
			$str.= $minFix." min ";
		if($secFix > 0)
			$str.= $secFix." sec ";
		return $str;
	}
	echo '<br>Difference is : '.dateDifference("2011-09-18 10:00:00", date('Y-m-d H:i:s'));
?>
vibhaJ 126 Master Poster

I am not codeIgniter programmer but you can use ajax to call one php page that will load result.

vibhaJ 126 Master Poster

1) either you need to make all config variable global inside function.
i.e.

function fname()
{
    global $LOCATION;
// now you can use $LOCATION
}

2) or you can define in Setup.inc.php:

define('LOCATION', 'http://www.rest/of/address');
// now you can use LOCATION (without  $ sign) in function file.
turt2live commented: Amazing help +3
vibhaJ 126 Master Poster

Is the code you have posted here for gallery.inc.php is in any function? Or it is outside? If its inside you need to make it global.
Generally i am always defining configuration variables.
e.g. define('SQL_HOST','localhost'); so that i can use it any where inside function.

vibhaJ 126 Master Poster

as per ardav:

$text = "this is description...this is description...this is descr[youtubeee]http://www.youtube1...[/youtubeee]iption...this is description...this is description...[youtubeee]http://www.youtube-two...[/youtubeee]this is description...this is description...this is description...this is description...this is description...this is description...";
preg_match_all ("/\[youtubeee\]([^`]*?)\[\/youtubeee\]/", $text, $output,PREG_OFFSET_CAPTURE);	
echo '<pre>';
print_r($output);

in array you will have offset, once you done with urlencode replace main string back using offset.

vibhaJ 126 Master Poster

Can you post how your variable is defined in setup.inc.php and how did you used it in gallery.inc.php?

vibhaJ 126 Master Poster

for jquery popup, check "Modal confirmation" link at right bottom of http://jqueryui.com/demos/dialog/#modal-confirmation

vibhaJ 126 Master Poster
echo '<td><a onclick="return confirm(\'Are you sure want to delete?\');" href="teachers_delete.php?Course_Id=' . $row['Course_Id'] .'" ><img src="images/delete.gif" /></a></td>';
vibhaJ 126 Master Poster

Mark thread solved if it is..

vibhaJ 126 Master Poster
onchange="window.location.href='http://www.mysitehere.com/subfolder/subfolder1/subfolder3/'+this.value;"
vibhaJ 126 Master Poster

You are fetching images based on categoryid passed in link viewproduct_by_category.php?categoryid=1.
So when you click next link url should also have categoryid i.e. viewproduct_by_category.php?categoryid=1&page=2.
Check in your coding whether you are getting it or not.

vibhaJ 126 Master Poster

check Draggable and Effects at this link http://jqueryui.com/demos/.
You need to customize jquery based on your requirement.