wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
[SOLVED] table displaying alernet codes... php not working :S
wildteen88 replied to runnerjp's topic in PHP Coding Help
Modified your code abit, not sure what you was doing with your first while loop but doesn't seem it was required <?php session_start(); require_once '../settings.php'; $sql = "Select * from forumtutorial_posts ORDER BY lastrepliedto DESC LIMIT 10"; $result = mysql_query($sql) or die("Could not get threads"); echo '<table width="500 border="0" >'; $i = 0; while($row = mysql_fetch_assoc($resul)) { $color = (($i%2 == 0) ? '#000000' : '#00468C'); echo "\n".' <tr bgcolor="'. $color .'"> <td>'.$row['title'].'</td><td>'.$row['author'].'</td> </tr>'; $i++; } echo ' </table>'; ?> -
[SOLVED] table displaying alernet codes... php not working :S
wildteen88 replied to runnerjp's topic in PHP Coding Help
$getthreads3[title] should be $row['title'] -
[SOLVED] Apache does not serve index.htm files
wildteen88 replied to jordanwb's topic in Apache HTTP Server
Its up to you. Adding it to a VirtualHost it'll only apply to that host. Whereas adding DirectoryIndex will apply globally. -
Cannot access http://localhost/index.php
wildteen88 replied to nati's topic in PHP Installation and Configuration
Add index.php to the DirectoryIndex directive in Apaches httpd.conf -
[SOLVED] table displaying alernet codes... php not working :S
wildteen88 replied to runnerjp's topic in PHP Coding Help
Change echo '<tr bgcolor="'. $currentcolor ."> <td><? echo $getthreads3[title]?> </td> </tr>'; to echo '<tr bgcolor="'. $currentcolor .'"> <td>'.$getthreads3[title].'</td> </tr>'; -
Cannot access http://localhost/index.php
wildteen88 replied to nati's topic in PHP Installation and Configuration
I never recommend to setup PHP in CGI mode. I always configure PHP as an Apache Module using the following instead: LoadModule php5_module "C:/php/php5apache2_2.dll" PHPIniDir "C:/php" AddType application/x-httpd-php .php -
There is an automated process you could use which requires gd. There are many tutorials on the net for creating thumbnails with gd.
-
cookies are stored as plain text in the browsers cache. Most modern browsers allow users to view all cookies stored in the cache. You should never store personal data within cookies this is what sessions are for (as sessions are stored on the server).
-
Cannot access http://localhost/index.php
wildteen88 replied to nati's topic in PHP Installation and Configuration
How have you installed PHP? During the process of installing PHP you'll need to configure Apache, in order for it to understand how to handle php files. -
Yes, you'll need to have two images for this to work. The actual image itself and a smaller version of the original image for the thumbnail. You'll then do something like this: echo "<br><strong> Image: </strong>"; echo '<a href="'.$row["Picture"].'"><img src="'.$row["PictureThumbnail"].'" /></a>';} The code will not work until you have field in your database called PictureThumbnail -- this will hold the path to the thumbnail for the image.
-
Two problems, your code doesn't even appear to use sessions. Cookies have nothing to do with sessions. The other problem is using cookies for storing the md5 hash of the user's password.
-
What is held in the variable $row["Picture"] Is it a path to an image or is it the binary code of the image itself? If is the first then just output an HTML image tag to display the image, eg: echo "<br><strong> Image: </strong>"; echo '<img src="'.$row["Picture"].'" />';} However for the latter its a bit more complex as you cannot display binary data within a HTML page.
-
I think you should explain what you're trying to do. I'm not understanding you.
-
The last four is caused by the use of the concatenation operator (.=), add $Model = $Description = $Category = $Image = null before your while loop
-
The code should not work at all no matter whatever error_reporting or display_errors is set to. The only way the code will work is if the OP has a setting called output_buffering set to On within the php.ini for thier WAMP setup, quote from the php.ini ; Output buffering allows you to send header lines (including cookies) even ; after you send body content, at the price of slowing PHP's output layer a ; bit. You can enable output buffering during runtime by calling the output ; buffering functions. You can also enable output buffering for all files by ; setting this directive to On. If you wish to limit the size of the buffer ; to a certain size - you can use a maximum number of bytes instead of 'On', as ; a value for this directive (e.g., output_buffering=4096).
-
echo "<p>Number of records found: ".$num_results."</p>"; while ($row = mysql_fetch_array($result)) { $Model .= '<td>'.$row['Model'].'</td>'; $Description .= '<td>'.$row['Description'].'</td>'; $Category .= '<td>'.$row['Category'].'</td>'; $Image .= '<td>'.$row['Picture'].'</td>'; } for ($i=0; $i <$num_results; $i++) { ?> <table> <tr><td><?php echo "<p><strong>".($i+1)."Model"; ?></td><?=$Model?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Description"; ?></td><?=$Description?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Category"; ?></td><?=$Category?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Picture"; ?></td><?=$Image?></tr> <?php } ?>
-
for ($i=0; $i <$num_results; $i++) { ?> <table> <tr><td><?php echo "<p><strong>".($i+1)."Model"; ?></td><?=$Model?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Description"; ?></td><?=$Description?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Category"; ?></td><?=$Category?></tr> <tr><td><?php echo "<p><strong>".($i+1)."Picture"; ?></td><?=$Image?></tr> <?php } ?>
-
That be only possible if your server has a torrent client installed. You then invoke the client via exec() or some other command function within php to start a torrent download.
-
No just escape all double quotes within the string except for the first and last quote, example Escape all the quotes highlighted in blue. Do not escape the quotes in red. TO escape you place a backslash in front of the quote like so \" or \'
-
Your parameters are round the wrong for mysql_query. Line 145 should be $result = mysql_query($sql, $cxn) or die ("Query died: user name");
-
By "close the array" do you mean remove the generated array made by mysql_fetch_* from memory after you have used it? You can do by using unset(). However PHP will automatically clear all memory the scripts consumes after the script has been executed.
-
You just need to add the relevant code in the included file then. If you post phptuts.php here I'll be able to incorporate the code I posted earlier for you.
-
You mean a webhost? Any host which runs PHP5 should support mysqli.