Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2013, 12:18 AM
Authorized User
 
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Default trouble with php

I recently upgrade xampp versions and even
though I get indication of good install, I can
key in 127.0.0.1 and create and edit databses,
all features of Xampp Console work but my php
is only producing php code. My files have been
running successfuly for years but not now. I have
uninstalled and reinstalled, even gone back
to my original version (1.7.4) with the same result.
I've been trying for days find the solution to this.
I really do need some advice. Below is a little
test program to illustrate and below that is the result.
PHP Code:
<?php
error_reporting
(E_ALL E_NOTICE);
//  error_reporting(0);
mysql_connect('localhost','root',' ');
mysql_select_db('pass') or die("Unable to select database");
$query=" SELECT * FROM word where id = '$id'";
$result=mysql_query($query);
$num=mysql_numrows($result);

echo 
"<table cellspacing=1 cellpadding=0 border=1>
<tr>
<th>dest</th>
<th>user</th>
<th>pas</th>
<th>url</th>
<th>savd</th>
</tr>"
;
while(
$row mysql_fetch_array($result))
{
echo 
"<tr>";
echo 
"<td>" $row['destination'] . "</td>";
echo 
"<td>" $row['username'] . "</td>";
echo 
"<td>" $row['password'] . "</td>";
echo 
"<td>" $row['url'] . "</td>";
echo 
"<td>" $row['savd'] . "</td>";
"</td>";
echo 
"</tr>";
echo 
"</table>";
mysql_close();
?>
Quote:
dest user pas url savd ";
while($row = mysql_fetch_array($result))
{ echo "";
echo "" . $row['destination'] . "";
echo "" . $row['username'] . "";
echo "" . $row['password'] . "";
echo "" . $row['url'] . "";
echo "" . $row['savd'] . "";
""; echo ""; echo ""; mysql_close();
?>
 
Old May 3rd, 2013, 03:12 AM
Friend of Wrox
 
Join Date: May 2011
Posts: 125
Thanks: 0
Thanked 24 Times in 24 Posts
Default

Greetings,

You have an extra "</td>"; in there and you are missing the closing } for the while loop.
 
Old May 4th, 2013, 02:55 PM
Authorized User
 
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Default

ataloss to useless - thanks for the response. I had at thsat code and couldn't
see; nevertheless it changed nothing
 
Old May 7th, 2013, 11:05 AM
Friend of Wrox
 
Join Date: May 2011
Posts: 125
Thanks: 0
Thanked 24 Times in 24 Posts
Default

Greetings,

Try running this;
Code:
<?php

phpinfo();

?>
and if that does not work then you will need to check your apache configuration.
 
Old May 15th, 2013, 02:20 AM
Authorized User
 
Join Date: Apr 2013
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Default

this is the changes I've made to configuration
Code:
<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'username'; 
/* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! *
/

/*
 * Servers configuration
 */
$i = 0;


/*
 * First server
 */
$i++;


/* Authentication type and info */
$cfg['Servers'][$i]
$cfg['Servers'][$i]['auth_type']     = 'cookie';      
// Authentication method (config, http or cookie based)


$cfg['Servers'][$i]['user'] = 'username';

$cfg['Servers'][$i]['password'] = 'password';


$cfg['Servers'][$i]['extension'] = 'mysql';

$cfg['Servers'][$i]['AllowNoPassword'] = false;
 
Old December 31st, 2013, 07:38 PM
Registered User
 
Join Date: Nov 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning PHP 5.3

Hello My situation is that I am not understanding the variables in a proper
way can somebody give me an Idea of what Im working with cos i must be missing something with the variables aid very happy with some help.
Thank You (josejaime321@gmail.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble connecting MySQL to PHP nofences84 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 14th, 2007 11:21 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM
trouble with Email and PHP Tachyon Beginning PHP 3 May 26th, 2004 03:58 AM
createmovie.php logon trouble JohnAlden BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 May 25th, 2004 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.