CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, Fhalcon, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Thu Jul 09, 2020 5:35 pm

All times are UTC




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
   

Topic review - php help
Author Message
  Post subject:  Re: php help  Reply with quote
Delete this and see if it works:
Code:
echo "Date: " . date("Y/m/d");
echo "Time: " . date("h:i:sa") . "<br>";

It appears to be echoing everything after the break's closing tag. If it does work, try:
Code:
echo 'Date: ' . date("Y/m/d");
echo 'Time: ' . date("h:i:sa") . '<br>';
Post Posted: Thu Apr 02, 2020 4:20 pm
  Post subject:  php help  Reply with quote
I'm trying to read records from database into table and select a target to display a particular record and its info and url. I then want to click on that record and o to that url. below is my code:
---------------------------------------------------------------------------------
<!DOCTYPE html><html>
<title>email menu</title>
<head>
</head>
<BODY bgcolor="#ccffff"><b><center>
<FORM name=Form action="" method=post>

<?php
echo "Date: " . date("Y/m/d");
echo "Time: " . date("h:i:sa") . "<br>";
$con=mysqli_connect("localhost","root","cookie","homedb");

if(mysqli_errno($con))
{echo 'Can't Connect to mySQL:'.mysqli_connect_error();}
else
{echo 'Connected to mySQL</br>';}

$query = mysqli_query($con,'SELECT target FROM emailtbl');
$query_display = mysqli_query($con,'SELECT * FROM emailtbl');
while($row=mysqli_fetch_array($query))

$target = $con->query('SELECT target FROM emailtbl');
while ($row = $target->fetch_array(MYSQLI_ASSOC)){ echo '
<option value="'.$row['target'].'">'.$row['target']. '</option>';
}

<input type="submit" name="submit" value="Submit">
</form>';
}

$con=mysqli_connect("localhost","root","cookie","homedb");
if(mysqli_errno($con))
{echo "Can't Connect to mySQL:".mysqli_connect_error();}
if(isset($_POST['target']))
{
$target = $_POST['target'];
$fetch="SELECT target, purpose, username, password, emailused, lastused, count, time, saved FROM emailtbl WHERE target = "$target";
$result = mysqli_query($con,$fetch);
if(!$result)
{echo "Error:".(mysqli_error($con));}
echo '<table border="1">'.'<tr>'.'<td bgcolor="#ccffff align="center">'. 'Email menu'. '</td>'.'</tr>';
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'
<td bgcolor="#D4AAFF align="center">'.'target'.'</td>'.'
<td bgcolor="#D4AAFF align="center">'.'purpose'. '</td>'.'
<td bgcolor="#D4AAFF align="center">'.'username'.'</td>'.'
<td bgcolor="#D4AAFF align="center">'.'password'.'</td>'.'
<td bgcolor="#D4AAFF align="center">'.'emailused'.'</td>'.'
<td bgcolor="#FFD4D4 align="center">'.'lastused'.'</td>'.'
<td bgcolor="#FFD4D4 align="center">'.'count'. '</td>'.'
<td bgcolor="#FFD4D4 align="center">'.'time'. '</td>'.'
<td bgcolor="#FFD4D4 align="center">'. 'saved' .'</td>'.'</tr>';
while($data=mysqli_fetch_row($result))
{echo ("<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td><td>$data[4]</td><td>$data[5]</td><td>$data[6]</td><td>$data[7]</td><td>$data[8]</td></tr>");}
echo '</table>'.'</td>'.'</tr>'.'</table>';
}
?>
</body></html>
===============================================================
below the result:
-----------------------
"; $con=mysqli_connect("localhost","root","cookie","homedb"); if(mysqli_errno($con)) {echo 'Can't Connect to mySQL:'.mysqli_connect_error();} else {echo 'Connected to mySQL
';} $query = mysqli_query($con,'SELECT target FROM emailtbl'); $query_display = mysqli_query($con,'SELECT * FROM emailtbl'); while($row=mysqli_fetch_array($query)) $target = $con->query('SELECT target FROM emailtbl'); while ($row = $target->fetch_array(MYSQLI_ASSOC)){ echo ' '; } '; } $con=mysqli_connect("localhost","root","cookie","homedb"); if(mysqli_errno($con)) {echo "Can't Connect to mySQL:".mysqli_connect_error();} if(isset($_POST['target'])) { $target = $_POST['target']; $fetch="SELECT target, purpose, username, password, emailused, lastused, visitcount, time, saved FROM emailtbl WHERE target = "$target"; $result = mysqli_query($con,$fetch); if(!$result) {echo "Error:".(mysqli_error($con));} echo ''.''.''.''; echo ''.''.''.'
'. 'Email menu'. '
'.''.''.' '.' '.' '.' '.' '.' '.' '.' '.' '.''; while($data=mysqli_fetch_row($result)) {echo ("");} echo '
'.'target'.' '.'purpose'. ' '.'username'.' '.'password'.' '.'emailused'.' '.'lastused'.' '.'visitcount'. ' '.'time'. ' '. 'saved' .'
$data[0] $data[1] $data[2] $data[3] $data[4] $data[5] $data[6] $data[7] $data[8]
'.'
'; } ?>
Post Posted: Wed Nov 13, 2019 9:52 am

All times are UTC


Jump to:  
cron
Powered by phpBB © 2016 phpBB Group