wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Take out any instances of session_register as it is not needed. Doing $_SESSION[['username'] = $username would be sufficient. To create a session variable.
-
[!--quoteo(post=370822:date=May 3 2006, 10:18 AM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ May 3 2006, 10:18 AM) [snapback]370822[/snapback][/div][div class=\'quotemain\'][!--quotec--] Assuming that you have extracted the data from the database correctly, something like this should work [code]<? $email = $row['email']; $name = $row['name']; ?> <TD><a href="mailto:<?=$email?>"><?=$name?></a></TD>[/code] If its not what your looking for, post more of your code for us to see... [/quote] I would advise you not use <?= ?> tas as these are not enabled by defualt and so if use them some scripts may not function correct in different PHP setups. So I'd advise to do the following stead. [code]<? $email = $row['email']; $name = $row['name']; ?> <TD><a href="mailto:<?php echo $email; ?>"><?php echo $name; ?></a></TD>[/code]
-
All wat the constructor does is just setups the variables or calls other internal methods (functions) inside the class. There are two ways to define a constructor either create a function as the same name as the class name (the php4 way) or use the __construct function (PHP5 only).
-
Do you not get the [b]Error connecting to mysql[/b] message which you has setup when the mysql_conncet function fails. Is this a local install of Apache/PHP/MySQL on your PC? If so which version of PHP are you using? If its PHP5 did you enable the mysql extension and setup the extension_dir directive too in the php.ini? Also it would be a good idea too to enable display_errors too. As then if there is an error in your php script PHP will report the errors rather tnan hidding them too.
-
adding a variable as a form is submitted
wildteen88 replied to mattennant's topic in PHP Coding Help
You already have setup a hidden form field in your form called thankyou and the form is getting suvmitted to itself, so you can just do the following instead: [code]<input type="text" name="email" value="<?php if (isset($_POST['thankyou'])) { echo "thankyou"; } ?>" size="23">[/code] -
Yes the old $HTTP_*_VARS variables will not exist as of PHP6 and they are also disabled by defualt as of PHP4.1.0. You can still use them by turning [b]register_long_arrays[/b] on in the php.ini. But they are becoming depreciated, hense why they are going to be removed as of PHP6 I believe.
-
Whole forum inside one big frame?
wildteen88 replied to zq29's topic in PHPFreaks.com Website Feedback
Yes it is FF that puts in the secound (uneeded) scroll bar. FF only seems to put this scroll bar after the javascript links have been added into the page. i have no idea why though. But I swear this has only just started to happen about a week ago. If you have javascript disabled it doesnt add in the extra scroll bar, however page takes a little longer to load. -
What do you mean by auto-delete code you explain a but more about what you are trying to do.
-
Dont use HTTP_*_VARS variables use the new superglobal arrays (_POST, _GET, _COOKIES, _SESSION, etc). So use the following: [code]<?php $user = $_COOKIE['user']; echo "Hello " . $user; ?>[/code]
-
Some thing like this should do: [code]<?php $i = 0; while ($row_property = mysql_fetch_assoc($property)) { $bg = ($i%2) ? "E1E1E1" : "FFFFFF"; ?> <tr style="background-color: #<?php echo $bg; ?>"> <td><?php echo $row_property['P_ID']; ?></td> <td><a href="property_details.php?P_ID=<?php echo $row_property['P_ID']; ?>"><?php echo $row_property['P_address']; ?></a></td> <td><?php echo $row_property['P_type']; ?></td> <td>$ <?php echo number_format($row_property['P_price'],0); ?></td> </tr> <?php $i++; }?>[/code]
-
Others may not get the notice message becuase they may have error reporting turned off or is set not report any notice errors. Now the reason why you are getting the notice error is becuase when php goes through the while loop for the first time in the makeRandomPassword function the $pass variable doesn't actually exist, until the it loops through the secound time. To stop php from displaying the message either place the @ symbol in front of $pass like so: [code]@$pass = $pass . $tmp;[/code] or first create the $pass variable with a blank value before the while loop like so: [code]$pass = ""; while ($i <= 7) {[/code]
-
Could you provide details on the versions of PHP and MySQL. Also I believe you have to configure MySQL to use the old passwords directive to sort this issue out.
-
The main reason why your're geting the following error message: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\foreign\easyphp1-8\www\agence\test\pasoub.php on line 74[/quote]is becuase your havn't setup PHP to use an SMTP Server. PHP needs to be pointed to an SMTP server in order to send the emails, with out an SMTP server your emails are going no where! To setup up PHP to use an SMTP server you'll need to edit your php.ini file and find the following line: [code]SMTP = localhost[/code] Change localhost to the smtp address. The address will be like the following: [i]smtp.hostname.com[/i]. Usually you'll find your ISP will have an SMTP server you can use. Once you have applied the changes save your php.in file and restart Apache
-
Is it me or do I see a massive banner to the right advertisiong webhsoting? [!--sizeo:4--][span style=\"font-size:14pt;line-height:100%\"][!--/sizeo--][div align=\"center\"][a href=\"http://www.serverpowered.com/vps.php\" target=\"_blank\"]Server Powered Webhosting[/a][/div][!--sizec--][/span][!--/sizec--] There is also [a href=\"http://www.webhostfreaks.com/web-hosting.php\" target=\"_blank\"]Webhost Freaks[/a] too.
-
This should work: [code]body { font-family: Arial, Helvetica, sans-serif; background: #6F8DBF url("css_800/mybkgd.jpg") repeat-x fixed bottom; margin: 0px; padding: 0px; }[/code]
-
You shouldn't run the .exe files in the bin folder directly. They are not designed be executed through windows explorer. The way you execute the files in the bin folder is the in the command line. Click Start > Run > type in cmd and click OK. The Command Line window should appear. Now type in the following: [code]cd C:\MySQL\bin[/code] and click enter now type in the following: [code]mysql-nt --install[/code] This will start the MySQL service. Then to stop mysql use the following, in the correct order: [code]net stop MySql mysql-nt --remove [/code] Before you run the above command make sure you are in the MySQL bin folder.
-
Did you set up the extension_dir directive? Look for the following line in the php.ini: [code]extension_dir = "./"[/code] change [b]./[/b] to the full path to where the php extension folder is located to, ie C:\php\ext Now you need to save the php.ini and look a for a file called libmysql.dll and copy that to the Windows folder or add the php folder to the Windows PATH variable instead, saves moving any files. Now restart your Apache web server and you should be able to use the mysql functions.
-
[code]$mg2->getlanguages();[/code] Yes what the code does is execute the function getlanguages in the [b]mg2[/b] class. I think what getlanguages() function does is gets all the lanaguges from a database and then stores them in a variabale in side the mg2 class.
-
The function you are looking for is mysql_fetch_array: [code]$sql = mysql_query (select * from table where user = $username); $row = mysql_fetch_array($sql); //then whenm you want to show the results do this: echo $row['user']; echo $row['pass']; //other row names here [/code]
-
I corrected the issue for you. I think you had a typo with the img tags.
-
You want to use number_format then assign the $ in front of the number manually
-
miniBB is a simple forum with very little features it is a good start to study the code from, however the code (unless they've changed how they code) is a little messy! And a little complticated to follow. [a href=\"http://www.minibb.net/\" target=\"_blank\"]http://www.minibb.net/[/a]
-
In order to use the mail function you will need to point php to a local/public SMTP server, one that doesn't require a login. Usually you'll find your ISP will have one and the address is something along the lines of [b]smtp.ispname.com[/b] YOu can setup the smtp server address in the php.ini file. Open the php.ini file for editing and find the following line: [code]SMTP = localhost[/code] change localhost to the smtp servers address. Now save your php.ini anmd restart your Apache web server.
-
Yes functions in PHP are case insensitive, the following is taken from php.net: [quote][b]Note: [/b] Function names are case-[b]in[/b]sensitive, though it is usually good form to call functions as they appear in their declaration.[/quote] heres an example: [code]<?php function test() { echo "works"; } tesT(); TEST(); TeSt(); test(); ?>[/code]All four functions are the same!
-
ini_set allows you to temporarly change PHPs setting. Some developers do the following: [code]ini_set('arg_separator.output','&');[/code] so that when they validate their code with the W3C's HTML Validator it doesn't break their xHTML validation. As the validator will won't class your HTML as valid xHTML if your links has an & in them. Instead developers use the HTML entities version (&) of the ampersand.