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

You can not use session during forget password.
Also you can only use email for checking:

<?
$email = $_POST['email'];
$queryget = mysql_query("SELECT username FROM user WHERE email = '$email'") or die("query didnt work");
$num_rows = mysql_num_rows($queryget);
if($num_rows > 0)
{
    $row = mysql_fetch_assoc($queryget);    
    $username = $row['username'];
    // Send email to {$email } whose username is  {$username}
}
else
{
    // such email doesn't exist
}
?>
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

First check if uploaded image is properly stored in your specified folder or not:
http://www.w3schools.com/php/php_file_upload.asp

vibhaJ 126 Master Poster

in that case:
let your post listing code is in list.php where all posts names are listed.
Now use below code for generating link.

echo '<li><a href="posts.php?ID='.$arr['id'].'">'.$arr['name'].' '.$arr['location'].'</a></li>';

Now when you click on post name, you will be redirected to posts.php?ID=23 // some ID.
Now on posts.php you need fetch data from database based on passed ID.

$query = "SELECT * FROM table1 where ID=".$_GET['ID'];

and then you can show all data for that id on posts.php.

vibhaJ 126 Master Poster

Have you set img field as a primary key?

vibhaJ 126 Master Poster

Make thread solved !

vibhaJ 126 Master Poster

ob_start() must be before session_start().

<?php 
ob_start();
session_start();

And make sure there is no blank space before session_start().

vibhaJ 126 Master Poster

When user login you can set user's id in session.

$_SESSION['sess_userId'] = 12; // whatever id

Below is the function check if user is login or not.

function isUserLogin()
{
    if(!isset($_SESSION['sess_userId']))
    {       
        header("location:login.php");
        exit;
    }   
}

Now call this functionisUserLogin(); on top of page where you want guest restriction.
Not include in global.php otherwise all page will be asked for login.

vibhaJ 126 Master Poster

You need to change setting in php.ini for larger file upload.

Check this link http://www.sitepoint.com/upload-large-files-in-php/ OR http://drupal.org/node/97193

Try this and check if it is working.

vibhaJ 126 Master Poster

When user click on link user will be redirected to another page post.php, and on post.php all details should be displayed.. right??

Another case is when you click on link on the same page one popup will display all details using javascript.

So what you want??

vibhaJ 126 Master Poster

yup..

vibhaJ 126 Master Poster

If you want to check that session's value on other pages, i.e. if user is logged in or not, then you have to add it on all top of page.

vibhaJ 126 Master Poster

Clear all cookies in browser and then check.

vibhaJ 126 Master Poster

id is missing in query.
$query = "SELECT id, type, name, location, landmark FROM table1";

It seems strings are not concatinated properly. Try this:

<?
 $output = "";
 while($arr = mysql_fetch_array($result, MYSQL_ASSOC))
 {
     $output.='<li>
            <a><a href="posts.php?ID='.$arr['id'].'&type='.$arr['type'].'&name='.$arr['name'].'">'.$arr['name'].' '.$arr['location'].'</a>
            <br /><p>Name: '.$arr['name'].'</p>
            <br /><p>Type: '.$arr['type'].'</p>
            <br /><p>Location: '.$arr['location'].'</p>
            </li>';
  }
  echo $output;       
?>

For more on concatenation read this http://www.daniweb.com/web-development/php/threads/369623/syntax-prpblems#post1588766

vibhaJ 126 Master Poster

Are you checking in local system? You won't receive email without SMTP.
Once you upload this to LIVE you will get emails.

vibhaJ 126 Master Poster

$cnt

I forget to increase $cnt variable.

use $cnt++ before endforeach.

<?php 
    if(($cnt+1)%$grid==0) echo '</tr>';
    $cnt++;
  endforeach ?>
vibhaJ 126 Master Poster

Try this::

<div class="planbooks">
<b><?php echo date(" 'F 'y") ?></b>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
  <?php 
  $grid = 12;
  $cnt = 0;
  foreach ($planbooks as $planbook): 
    if($cnt==0 || $cnt%$grid==0) echo '<tr>';
  ?>
    <td><div id="planbook-content" class="float" >
      <a class="musttry" href="#" onclick="musttry_add()" >MustTry</a>
      <div><img src="/uploads/planbook/<?php echo $planbook['photo'] ?>" alt="" /></div>
      <div> <span class="field-label"> Title: <?php echo $planbook['title_name'] ?></span></div>
      </br>
      Country: <?php echo $planbook['country_id'] ?></span><br /></td>
  </tr>
  <div> <span class="field-label">Area: <?php echo $planbook['zone_id'] ?></span><br />
  </div>
  <div> <span class="field-label">Place: <?php echo $planbook['place'] ?></span><br />
  </div>
  <div><span class="field-label">Occasion: <?php echo $planbook['occasion'] ?></span></div>
  <div> <span class="field-label">Itinerary: <?php echo $planbook['itinerary'] ?></span><br />
  </div>
  <div><span class="field-label">Date: <?php echo $planbook['date'] ?></span><br>
  </div>
  <div><span class="field-label">Description: <?php echo $planbook['description'] ?></span><br />
  </div>
    </div> 
    </td>  
  <?php 
    if(($cnt+1)%$grid==0) echo '</tr>';
  endforeach ?>
</table>
</div>
vibhaJ 126 Master Poster

if file is exist under images folder it should show, post any one one FileName value from database.

vibhaJ 126 Master Poster

Check what echo "<tr><td>".$row['FileName']."</td>"; is showing and check if that file exist under images folder?

Also is this php page is at root?

vibhaJ 126 Master Poster

Did it worked??

vibhaJ 126 Master Poster

";

<? while($row = mysql_fetch_array($result)) {  ?>
    <tr>
        <td><?php echo $row['ID']; ?></td>
        <td><input name="txtf" type="text"></td>
        <td><input name="txtf1" type="text" /></td>
        <td><input name="txtf2" type="text" /></td>
    </tr>
<? } ?>
Shougat commented: Thankyou +0
vibhaJ 126 Master Poster

1) Create one config.php file and add database connection code there. Include that config.php file on top of your page. No need to connect database multi time on page.

2) After your insert query code, use header function and redirect page . Otherwise each time you hit F5 one entry will be done.

3) Also i didn't see closing of form tag.

3) You can move select query code on top. So all php code will be on top of PHP, it is good practice. Don't use more PHP lines in between of HTML tags.

4) Use some code indent. So it will be easy to read :)

Rest your code is okay... That's IT !!!

vibhaJ 126 Master Poster

Give some efforts and and post your code here for more help.

vibhaJ 126 Master Poster

Check this link:
http://www.w3schools.com/php/php_mysql_intro.asp

Check all tutorials one by one. You will learn all things step by step.

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

Your requirement is bit not clear. Just a guess.
When you add language bt clicking submit button, you need to use insert query.
While on page listing you need to use select query to fect all records from database.

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
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

Your magento url is:
../product/2/?imagenv=data:image..

Try with:
../product/2/imagenv/data:image..

vibhaJ 126 Master Poster
<?
$to = 'myemail@gmail.com';
$subject = 'test subject';
$message = 'this is <strong>html</strong> <img src="http://l.yimg.com/a/i/ww/met/yahoo_logo_in_061509.png" > message';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
echo '->'.mail($to, $subject, $message, $headers);
?>

This worked for me. But if you are giving image as a src then that image will be come loaded from live. So if you are using gmail, it will ask something like Images are not displayed. Display images below.

But if you want image as a content in email you need to take image data and add it message rather than giving url.

I use phpmalier class. It is very easy to use.

vibhaJ 126 Master Poster

Try using someanother live image.. example http://l.yimg.com/a/i/ww/met/yahoo_logo_in_061509.png or any other which is directly image file and not php.

vibhaJ 126 Master Poster

post your html code for ul, li combination.

vibhaJ 126 Master Poster