fugix
Members-
Posts
1,483 -
Joined
-
Last visited
Everything posted by fugix
-
a quick revision to the code above to 3 lines if ($url == 'www.specialpizza.com') $site = 'Special Pizza'; if ($url == 'www.mainstreetspecialpizza.com') $site = 'Main Street Pizza'; if ($url == 'www.elmstreetspecialpizza.com') $site = 'Elm Street Pizza'; $_SERVER['SERVER_NAME'] outputs www. included in the server name
-
since $_GET is an associative array, you can also use array_key_exists() there are several ways to do what you want
-
placing the code in a while loop should fix the problem of only displaying one row, however I have realized an error that i made in the previous code, I placed the closing </table> tag inside of the while loop which I should not have done....try this instead. $result = mysql_query("SELECT * FROM `members` WHERE username='".$_SESSION['username']."' limit $eu, $limit"); while($fetch_users_data = mysql_fetch_object($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo "<tr >"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementdate."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementtrasct."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->amounttransact."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->intacctbal."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->charges."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->acctbal."</font></td>"; echo "</tr>"; //removed the </table> tag below }
-
since you wish to display more than one row, you will need to place you mysql_fetch_object() function inside of a while loop. Also, I recommend puting your query into a variable before using it inside of the function $result = mysql_query("SELECT * FROM `members` WHERE username='".$_SESSION['username']."' limit $eu, $limit"); while($fetch_users_data = mysql_fetch_object($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo "<tr >"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementdate."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->statementtrasct."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->amounttransact."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->intacctbal."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->charges."</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>".$fetch_users_data->acctbal."</font></td>"; echo "</tr>"; echo "</table>"; } Edit: since "members" is not a mysql reserved word, you do not need to wrap it in backticks, however this is still acceptable
-
Help creating a hyperlink with images stored in variables.....
fugix replied to judda's topic in PHP Coding Help
ah I see, that would explain it. Glad you found your error. I don't recommend storing HTML code inside of a variable in the future, causes confusion when incorporating the variable into your code. -
Help creating a hyperlink with images stored in variables.....
fugix replied to judda's topic in PHP Coding Help
can you show more code where you set your $imagetoshow variable -
can you post your code please
-
Help creating a hyperlink with images stored in variables.....
fugix replied to judda's topic in PHP Coding Help
you have forgotten to place you href and src attributes inside of quotations. print "<tr><td><a href='$imagetoshow'><img src='$imagetoshow'></a></td><td>$title $subtitle</td><td>$location</td><td>$blurb</td></tr>"; -
Problem Uploading Image Files to Windows Server, permission denied
fugix replied to TecTao's topic in PHP Coding Help
have you read my edited post? -
the error isn't caused by the code that I provided, most likely your are missing a closing curly bracket somewhere. If you cant figure it out post your code and I will look at it
-
<form method="post" action="#"> <!-- form contents --> </form>
-
use the complex syntax on your session inside of you query, also, add some debugging just in case that fails <?php $query = "SELECT * FROM selections WHERE username = '{$_SESSION['username']}'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { ?>
-
Problem Uploading Image Files to Windows Server, permission denied
fugix replied to TecTao's topic in PHP Coding Help
Edit: misread the title. Found this piece from php.net -
is your movie_year field an INT?
-
change print_r($_POST['senderID']); to print_r($_POST); to make sure all necessary data is being past except for the senderID, post your results
-
why are you using javascript to validate your form instead of php? javascript can be disabled. Is your $_POST['senderID'] empty? Try using print_r($_POST); after your reply form has been submitted to see what is happening to that value
-
I'm confused I don't understand i believe Pikachu means the actual file that contains <td><img src="images/blog/<?php echo $row_Recordset1['filename'];?>"/> </td>
-
what are the contents of your $row_Recordset1['filename']
-
I notice that you are using $_SERVER['PHP_SELF'] as your action in your forms. I do not recommend doing this as there are several risks to doing this, XSS injection etc... Also, can you show the code specific to handling the replies please
-
can explain further what you mean by "response" please
-
when you specify your $query value twice, you are actually overriding the first value of $query. I recommend doing something like this. $section1 = $_POST['section1']; $section2 = $_POST['section2']; $query="INSERT INTO selections (section1, section2) VALUES ('$section1', '$section2')"; mysql_query($query) or die ("Error updating database: " . mysql_error());
-
if($_SESSION['user']==1){ $option='edit'; } elseif($_SESSION['user']==2){ $option='approve/deny'; } im assuming that neither of theses conditions are met, therefore you $options variable is never set
-
Welcome, feel free to ask us any questions along the way of your learning php
-
http://dev.mysql.com/doc/refman/5.0/en/update.html
-
Can you post our code please