wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Mysql_connect -- 4th Parameter Question -- $new link
wildteen88 replied to shanejeffery86's topic in PHP Coding Help
Yes setting the forth parameter to true will always yield a new connection. -
[SOLVED] Dynamically populate text field
wildteen88 replied to ashrobbins87's topic in PHP Coding Help
if this is done while the user is typing their first/surename you wont be able to do this with PHP. You'll have to use javascript for this. -
Question: Is it posible to use PHP vars inside an HTML email?
wildteen88 replied to T2theC's topic in PHP Coding Help
The way you have coded it is wrong. Your HTML needs to be wrapped in quotes you cant do $var = <html><bah><?php echo $foo; ?></blah><html> It needs to be like $var = "<html><bah>$foo</blah><html>" However if you have lot of HTML you can use the HEREDOC sytax $var = <<<HTML <html><bah>$foo</blah><html> HTML; -
Question: Is it posible to use PHP vars inside an HTML email?
wildteen88 replied to T2theC's topic in PHP Coding Help
You'll need to post more code than that. The problem resides somewhere else in your script -
[SOLVED] Extra stuff echoed from a 'hello.php' page
wildteen88 replied to cozmosys's topic in PHP Coding Help
What text editor are using to create your .php script? You should use a plain text editor such as Notepad. Also make sure you are saving the file as ASCII encoding -
Anyone see whats wrong with this? I can't.....
wildteen88 replied to dewey_witt's topic in MySQL Help
No I meant echo the $sql variable. That way we know how your query is being constructed once the variables witihn your query have been parsed. echo $sql; -
Anyone see whats wrong with this? I can't.....
wildteen88 replied to dewey_witt's topic in MySQL Help
What does the query look like when you echo it before running mysql_query. -
The for loop within your while loop is causing the duplicate results. How your while loop should be: // initiate counter $i = 0; while($row = mysql_fetch_array($result)) { // alternete row color $bgcolor= ($i%2 == 0) ? '#adc5c8' : '#eeeeee'; echo "<tr bgcolor=$bgcolor>"; echo "<td>" . $row['event'] . "</td>"; echo "<td>" . $row['date'] . "</td>"; echo "<td>" . $row['minutes'] . "</td>"; echo "<td>" . "<a href=\"{$row['pdf']}\">Download</a>" . "</td>"; echo "</tr>"; // increment counter $i++; }
-
Anyone see whats wrong with this? I can't.....
wildteen88 replied to dewey_witt's topic in MySQL Help
String value should always be wrapped within quotes. -
Yes everytime you refresh the page mysql_connect will be called. However mysql_connect will not establish a new connection if there is an existing one.
-
Question: Is it posible to use PHP vars inside an HTML email?
wildteen88 replied to T2theC's topic in PHP Coding Help
Adding a variable within php tags will not result in anything. If you want to print the contents of the variable to the screen you need to echo it <td> <?php echo $firstname ?> </td> This has nothing to do with PHP. This is handled by your shopping cart script. -
Yeah I have made mistake in that code Change $online[] to $onlineUsers[] and then change implode(',', $online) to implode(',', $onlineUsers) Should sort the error out.
-
For looping through mysql results use a while loop rather than a for loop $online = mysql_query("SELECT username FROM online") or die(mysql_error()); if(mysql_num_rows($online) > 0) { while($row = mysql_fetch_assoc($online)) { $online[] = '<A href="member_profile.php?username='.$row['username'].'">'.$row['username'].'</a>'; } echo '<tr class="mainrow"><td>Currently active: ' . implode(',', $online) . '</td></tr>'; } else { echo '<tr class="mainrow"><td>There are currently no users logged in</td></tr>'; } echo '</table>';
-
The error is caused be cause on line 2 in lose2.php you have some form of output. Make sure you don't have anything before your opening php tag (<?php)
-
The setting is called short_open_tag However you should use full PHP tags. This way your code will much more portable.
-
You could run a SELECT DISTINCT query.
-
[SOLVED] PHP Post, can you store these variables into an array?
wildteen88 replied to SchweppesAle's topic in PHP Coding Help
You can name your checkboxes as name[] that way when the form is submitted all checkbox values will be held within the $_GET['name'] array -
Trying to accsess String as an array in loop.
wildteen88 replied to rkaganda's topic in PHP Coding Help
$str should be $str[$i] -
help with inserting $variable within <td> tags
wildteen88 replied to webguync's topic in PHP Coding Help
If all you're doing is echo'ing a variable quotes are not necessary -
Don't forget you will need to define a width for your div aswell in order for auto margins to work.
-
help with inserting $variable within <td> tags
wildteen88 replied to webguync's topic in PHP Coding Help
echo "<td>$CallNumber</td>"; -
Maybe easier to use a definition list
-
No. You don't need to specify the query string within your rewriteRule. All you need to do is specify the bits you're rewriting. So if you url is like this: example.com/bar/bar2/?foo3=bar3&foo4=bar4 You just need to setup your rewriteRule to match the bits highlighted above. Which is what the following rewriteRule does. RewriteRule ^(.*)/(.*)/ index.php?foo=$1&foo2=$2 [L,QSA] I have tested this and it works fine for me.