vibhaJ 126 Master Poster

From Google...

<?php
// ------------------------------------------------------------
function recursive_remove_directory($directory, $empty=FALSE)
{
    if(substr($directory,-1) == '/')
    {
        $directory = substr($directory,0,-1);
    }
    if(!file_exists($directory) || !is_dir($directory))
    {
        return FALSE;
    }elseif(is_readable($directory))
    {
        $handle = opendir($directory);
        while (FALSE !== ($item = readdir($handle)))
        {
            if($item != '.' && $item != '..')
            {
                $path = $directory.'/'.$item;
                if(is_dir($path)) 
                {
                    recursive_remove_directory($path);
                }else{
                    unlink($path);
                }
            }
        }
        closedir($handle);
        if($empty == FALSE)
        {
            if(!rmdir($directory))
            {
                return FALSE;
            }
        }
    }
    return TRUE;
}
// ------------------------------------------------------------
recursive_remove_directory('install');
?>
BadManSam commented: Thanks This Script Worked +0
vibhaJ 126 Master Poster

As blocblue says you can set timezone.
If you have access of php.ini, you can also set timezone in directly php.ini.

vibhaJ 126 Master Poster

Try this code:

echo $query = "SELECT link FROM asmmanual WHERE id = '".$q."'"; exit;

You will see one quesy in browser, copy that query and run it in your mysql query window.
Post what is your query output.

vibhaJ 126 Master Poster

Make sure you have proper src to show image in browser.
Your src can be relative or absolute.

1) http://localhost/nseries/A2-1C1-1B.png

OR

2) nseries/A2-1C1-1B.png (considering php page running this code is placed beside nseries folder.)

vibhaJ 126 Master Poster

what is error line number?
Also for testing remove all comments once and then try.

vibhaJ 126 Master Poster

post your code.nobody can assist you without looking in your code.

vibhaJ 126 Master Poster

Okay..good.. Read my signature :)

vibhaJ 126 Master Poster

I am not sure if you can access via this.
But can you have access of image storage of other machine? If yes you can save image in wamp folder.

vibhaJ 126 Master Poster

You have to use . (dot) for concatenation and not +.

So this:

echo ('result es ' + $result);

Should be

echo ('result es '. $result);
vibhaJ 126 Master Poster

When you insert image in database use chunk_split function as shown below.

$image = chunk_split(base64_encode(file_get_contents($_FILES['fileupload']['tmp_name'])));

After that check, if still it is not working comment below line
// header("Content-type: image/jpeg");

and open get.php in other tab of browser, check if you having any error?

hwoarang69 commented: yeahh +0
vibhaJ 126 Master Poster

Your image's field datatype must be BLOB or LONGBLOB.

hwoarang69 commented: thanks +0
vibhaJ 126 Master Poster

What is datatype of image field in mysql table?

hwoarang69 commented: blob +0
vibhaJ 126 Master Poster

It should be. I think just before few mins you have post all extensions from php.ini and it was there,
Even when you check php configuration from browser (from test.php and code which i have posted above), you will see box for "openssl".

hwoarang69 commented: ty +0
vibhaJ 126 Master Poster

I forget to tell you, if you do any changes in php.ini file, you need to restart your server to see changes.

hwoarang69 commented: so happy this works! +0
vibhaJ 126 Master Poster

Add below code in test.php file and run it in browser, you will see all PHP configuration.

<?php
phpinfo();
phpinfo(INFO_MODULES);
?>

Now look into Loaded Configuration File , it will show php.ini file path.

hwoarang69 commented: ty +0
vibhaJ 126 Master Poster

You need to enable OpenSSL extension.
Edit your php.ini file and remove comma in front of openssl.

extension=php_openssl.dll

hwoarang69 commented: ty +0
vibhaJ 126 Master Poster

Code i have tried:

<html>
<head>
<title>PHPMailer - SMTP (Gmail) basic test</title>
</head>
<body>
<?php
error_reporting(E_STRICT);

date_default_timezone_set('America/Toronto');
require("phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

$body = "this is <strong>testing</strong> mail ". date('Y-m-d H:i:s');

$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username   = "****@***.com";  // GMAIL username
$mail->Password   = "*****";            // GMAIL password

$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject    = "PHPMailer Test Subject via smtp (Gmail), basic";
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);

$address = "youraddress@test.com"; // add your address here 
$mail->AddAddress($address, "Gmail Test");

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
?>
</body>
</html>
hwoarang69 commented: :) +0
vibhaJ 126 Master Poster

You have blank space in host name.

Also add $mail->SMTPDebug = 2; in your code for debugging.

$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
hwoarang69 commented: ty +0
vibhaJ 126 Master Poster

Yes you can test in local, If you have gmail account you can do it as shown here

vibhaJ 126 Master Poster

Once you go live and upload your site on live server it will send email as generally all server supports SMTP.
But if server is restricted, you have to give SMTP settings which will be given by your hosting providers.
Better if you have any live server, upload your test page on LIVE and then test.

vibhaJ 126 Master Poster

If you are working in local system, you need SMTP settings to send email.

Either you can use SMTP credentials as shown here
OR you can use your own Gmail credentials as shown here

vibhaJ 126 Master Poster

Becuse your email message body is not set, you can set it by:

$mail->IsHTML(true);
$mail->Body = $body;
vibhaJ 126 Master Poster

Latest version is v5.2.0, you are using too older version which will not support latest PHP.

hwoarang69 commented: works +0
vibhaJ 126 Master Poster

Which PHPMailer version you are using?? It seems old.
Try to download latest package from http://phpmailer.worxware.com/

hwoarang69 commented: works +0
vibhaJ 126 Master Poster

Try this:

$sql="UPDATE users SET 
        userid = '$_POST[userid]',
        firstname = '$_POST[firstname]',
        lastname = '$_POST[lastname]',
        email = '$_POST[email]',
        username = '$_POST[username]',
        password = '$_POST[password]',
        role = '$_POST[role]'
        WHERE condition = 'value'";
vibhaJ 126 Master Poster

post your code to see what is at line no.16

vibhaJ 126 Master Poster

You should disable notice.
Add below line on top of your php page.

error_reporting(0);

You can also disable warnings globally by changing in php.ini file.

vibhaJ 126 Master Poster

Add isset for session.

   if (isset($_SESSION['username']))
            echo "Hello ".$_SESSION['username']." â™”<a href='logout.php'> Logout </a> ";
vibhaJ 126 Master Poster

Strict Standards: Only variables should be passed by reference

Try changing code at line number 8:

$imagename = end(explode('/',$_POST['img']));
$img = mysql_real_escape_string($imagename);
vibhaJ 126 Master Poster

Post your code..

vibhaJ 126 Master Poster

Add below line in top of php code. You can also set this value from php.ini.
date_default_timezone_set('America/New_York');

vibhaJ 126 Master Poster

If you are working in local system, mail function will not work due to SMTP.
Once you upload it on live server it will work as most live server have SMTP default set.

vibhaJ 126 Master Poster

>

Change onclick

onClick="$('.fulldesc').hide();$('#full<?=$count?>').toggle('slow');"
vibhaJ 126 Master Poster

Ohh..
Replace
onClick="$('#full<?=$count?>').toggle("slow");"

with

onClick="$('#full<?=$count?>').toggle('slow');"

vibhaJ 126 Master Poster

Try this:

<html>
  <head>
    <title>Demo</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>                
    <style type="text/css">
    .shortdesc{ color:red;}
    .fulldesc{ color:green; display:none;}
    </style> 
  </head>
  <body>
    <table>
    <?php

    for($count=1; $count<=10; $count++)
    {?>      
        <tr id="short<?=$count?>" onClick="$('#full<?=$count?>').toggle("slow");;" class="shortdesc"><td><?=$count?> Short description</td></tr>                        
        <tr id="full<?=$count?>" class="fulldesc"><td>My Name is <?=$count?> and this is full description </td></tr>
    <?php
    }
    ?>
    </table>
  </body>
</html>
vibhaJ 126 Master Poster

<td><?php echo nl2br($row2['detail']); ?></td>

vibhaJ 126 Master Poster

When you echo details on page use nl2br function.

echo nl2br($detail);

vibhaJ 126 Master Poster
    SELECT *
    FROM tbl_test
    WHERE id
    IN ( 23,4,56,21,9)
    ORDER BY FIELD( id,23,4,56,21,9 )
vibhaJ 126 Master Poster

Why don't you save work.php as index.php ?

vibhaJ 126 Master Poster

No need to write such lengthy code.
Check parse_url function Click Here

vibhaJ 126 Master Poster

Is your text input name is contact[first_name] ??
Post your form code.

vibhaJ 126 Master Poster

This is one of my favorite website: Click Here
Here htaccess code is generated based on your selection, you just need to add it in root of your project.

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

Make thread solved..

vibhaJ 126 Master Poster

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

<br style="clear: both;">
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

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

Mark thread solved if it is..

vibhaJ 126 Master Poster

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