wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
[quote author=dbo link=topic=120155.msg493171#msg493171 date=1167408347]and your users have cookies enabled it will actually store session data in a cookie. If a user doesn't have cookies enabled the session data is stored on the server and you're set. [/quote] Thats not true. All sessions are stored on the server. No session data gets saved to a cookie. The only thing that gets saved to the cookie is the unique session id, which referees to the session stored on the server. If the user doesn't have cookies enabled then the session id will sent through the URL.
-
How is the remember me feature triggered? By a checkbox a user checks when logging in or when logging out? What parts of the session do you want to keep?
-
mysql_fetch_row doesnt return an associative array. Only a numerical array. Change mysql_fetch_row to mysql_fetch_assoc instead: [code]$strQuery = "SELECT vendorname, sum(cogs) as sumcogs FROM spec_registrar WHERE orderdate>='2006-01-01' GROUP BY vendorname HAVING sumcogs>=15000"; $result = mysql_query($strQuery) or die(mysql_error()); while ($ors = mysql_fetch_assoc($result)) { $strXML .= "<set label='" . $ors['vendorname'] . "' value='" . $ors['sumcogs'] . "' />"; } mysql_free_result($result);[/code]
-
try that: [code]<?php session_start(); if(!isset($_GET["currencyID"])) { $_SESSION["CurrencyID"] = isset($_SESSION["CurrencyID"]) ? $_SESSION["CurrencyID"] : 1; } elseif(isset($_GET["currencyID"])) { if(is_numeric($_GET["currencyID"])) { $_SESSION["CurrencyID"] = $_GET["currencyID"]; } } $CurrencySymbols = array( 1 => "\$", 2 => "€", 3 => "£" ); //Examples Made Up $CurrencyExchangeRate = array( 1 => 1, 2 => 0.759594, 3 => 0.510553 ); $ItemPrice = 80; $CurrencyPrice = $ItemPrice * $CurrencyExchangeRate[$_SESSION["CurrencyID"]]; echo $CurrencySymbols[$_SESSION["CurrencyID"]].$CurrencyPrice; ?> <html> <body> <a href="?currencyID=1"><img src="./usd.jpg" align="left" border="0" alt="USD" /></a><br /> <a href="?currencyID=2"><img src="./euro.jpg" align="left" border="0" alt="Euro" /></a><br /> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?currencyID=3">British Sterling</a><br /> </body> </html>[/code] You had some of your code in the wrong place.
-
You are not use any CSS what so ever! You are using HTML (attributes) to style your pages. The best place to learn CSS navigation is going to [url=http://css.maxdesign.com.au/]css.maxdesign.com.au[/url] - I'd recommend you to go through [url=http://css.maxdesign.com.au/listutorial/horizontal_introduction.htm]this tutorial[/url] as that is the style of menu you have. When you've done that tutorial you should be able to adapt the CSS to your menu.
-
[SOLVED] Cant install memcache for PHP 4.3.9.
wildteen88 replied to rolf's topic in PHP Installation and Configuration
In order to use that extension it will have to be the same version as the version of PHP your are using. Upgrade PHP to the latest version for PHP4 which is PHP4.4.4 -
you (should) only need to change the upload_max_filesize setting and that is perfectly fine.
-
I like the design. However I was a little disappointed when looking at the source. So much HTML for such a small design. Also avoid styling your web pages using HTML, use CSS for that - after all that's what CSS is for. Get rid of the javascript too for the menu. Can be done with CSS. Also drop the tables your site can easily be done with just CSS and Div's. Another thing is you are using a non-standard font - Haettenschweiler Never use non-standard fonts. As you cannot guarantee that everyone will have that font.
-
It'll be easier and better if you used a switch rather than if statements. Like so: [code]$tipo = $row_rs_clientes_detail['tipo']; switch($tipo) { case 'pilotos': echo '<a href="perfil_clientes.php?id=' . $row_rs_clientes_detail['id'] . '&tipo=' . $tipo .'">perfil</a>'; break; case 'equipas': echo '<a href="apresentacao_clientes.php?id=' . $row_rs_clientes_detail['id'] . '&tipo=' . $tipo . '">apresentação</a>'; break; case 'organizadores': echo '<a href="apresentacao_clientes.php?id=' . $row_rs_clientes_detail['id'] . '&tipo=' . $tipo . '">apresentação</a>'; break; }[/code]
-
You cannot use cookies on the same page you created them. In order to access the cookie you just created the page will have to be refreshed. Then the new cookie data will be loaded. Its to do with the headers. Reads up on how http headers work.
-
When you go to create the folder. Keep the folder name in a variable. Then use that variable when creating the file. Example: [code]<?php if(isset($_POST['submit'])) { $folder = $_POST['newFolder']; if(!file_exists($folder)) { if(!mkdir($folder)) { echo "Unable to create a new folder '$folder'"; } } $fileName = $_POST['newFileName']; $fileContents = $_POST['newFileContents']; $handle = fopen('./' . $folder . '/' . $fileName, 'wb'); fwrite($handle, $fileContents, strlen($fileContents)); fclose($handle); echo '<a href="./' . $folder . '/' . $fileName . '">' . $fileName . '</a> successfully crrated!'; } ?> <h1>Create New File and Folder</h1> <form action="" method="post"> Folder Name: <input type="text" name="newFolder" /><br /> File Name: <input type="text" name="newFileName" /><br /> File contents: <textarea name="newFileContents"></textarea><br /> <input type="submit" name="submit" value="Create!" /> </form>[/code] Extremely basic. But it shows what I mean.
-
How To Install Extensions -=- CentOs
wildteen88 replied to JustinK101's topic in PHP Installation and Configuration
I am not experienced with unix based systems however I do know in order to get extensions loaded you have to recompile PHP. -
Cant access MySQL from PHP script
wildteen88 replied to jeboy's topic in PHP Installation and Configuration
Did you read the FAQ I link you to? Also is PHP using the correct php.ini? You can check this by creating a test script (test.php) and then adding the following code to it: [code]<?php phpinfo(); ?>[/code] Look for the following line - [b]Configuration File (php.ini) Path[/b]. To the right of that it should have the full path to the php.ini it is using. Is the the path C:\WINDOWS\php.ini? -
[quote author=jagguy link=topic=120255.msg493101#msg493101 date=1167383428] I did have mysql on php4 but upgraded to php5 where php works but not mysql. I have apache2, mysql and php5(latest). I have set ext dir extension_dir = "c:\Program Files\Apache Group\Apache2\php\ext\" and uncommented the mysql_dll line in php.ini and restarted apache. My php.ini file is renamed from php.ini.recommened and put into c:windows [/quote] Maker sure you have also copied libmysql.dll to the WINDOWS folder too. Restart the server when you move/change configuration files. Also the FAQ thrope linked to should help you.
-
You only use apostrophes (') when dealing with values for columns not when dealing with column/table names. You should use back ticks for those (`). Backticks should only be used when you have a column/table name that has the same name as a reserved keyword.
-
I am not exprienced with this sort of thing, but I have seen people mention somthing like the following: make sure you have enabled port forwarding for port 80 on your router.
-
Trying to bypass this... can't have /dev/ in a text field
wildteen88 replied to play_'s topic in PHP Coding Help
change / to its HTML equivalent: add the following to the end of escape_date function [code=php:0]$data = str_replace("/", "/", $data);[/code] SO the function is now: [code]//function for escaping and trimming data function escape_data($data) { global $dbc; if (ini_get('magic_quotes_gpc')) { $data = stripslashes($data); } $data = mysql_real_escape_string(trim($data), $dbc) $data = str_replace("/", "/", $data); return $data; }[/code] -
Post lines 58 - 86 here from csv.class.php here please. I will have a look.
-
How To Install Extensions -=- CentOs
wildteen88 replied to JustinK101's topic in PHP Installation and Configuration
Your will need to recompile PHP in order to enable those extensions, example for the gd library: add the --with-gd option when compiling PHP. For the others you will do the same/something similar. Go to php.net for more info. -
The clues in the error message: Notice: Undefined offset: -5 in /opt/lampp/htdocs/custom-xshop/admin/classes/csv.class.php on line 82 line 82 in the csv.class.php
-
[quote author=gilly914 link=topic=119970.msg492675#msg492675 date=1167327716] Ok, Almost nobody answered my post and I don't know if it's because no one knows how to solve my problem or just because no one ever ran into this same problem... Well, after some research, I finally found out what was wrong. I decided to post this just incase someone might need it in the future... Here's what I did : First, I opened the php.ini file in the WINDOWS/system32 folder. I turned the "display_errors" parameter to On (Off by default). I then got an error message, something like : "Undefined function : mysql_connect()" I searched for it on google, php.net and mysql.com. I found out that because changes made in the newer version of PHP (PHP5), some changes need to be made to work with MySQL on IIS. The changes are : - Open php.ini again and uncomment the line : "extension=php_mysql.dll" - Copy the files php_mysql.dll and libmysql.dll to your WINDOWS/system32 folder. And thats it!!... Restart your computer, and it should work with no problem... You can turn the "display_errors" setting back to "Off" so you don't see all the unnessacery errors. I hope I helped some of you folks out there that one day will decide to install PHP and MySQL on the Microsoft IIS Platform... [/quote] Whenever you are developing scripts you should always turn on errors have set the error reporting to E_ALL or higher. You only turn display_errors off when you have finished development. Also I do have a thread in the FAQ/Code Snippet Repository about the undefined mysql function errors
-
The problem is to do with this: [code]$config = array ( host => "localhost", db => "******", user => "*****", pass => "******", library => "****" );[/code] It should be: [code]$config = array ( 'host' => "localhost", 'db' => "******", 'user' => "*****", 'pass' => "******", 'library' => "****" );[/code] Note you didn't wrap your keys in quotes when setting the config array up. Whenever you use strings for keys in arrays always wrap them in quotes. Do not leave them out even though PHP lets you off. About the underfined offset notices. Post lines 58 - 86 here from csv.class.php here too. There is nothing wrong with posted code.
-
you may have a setting called magic_quotes_gpc enabled which causes this. You can either disable this or do what bljepp69 suggested.
-
is that the full code for contactUs.php? It doesnt look like it. Also do you get any other errors/messages too? NickG21 If it is add ob_start() at the start of the script (after <?php) and ob_end_flush() before (?>)
-
rename php.ini-recommended to php.ini and move that to C:/WINDOWS. Open the php.ini for editing and find the following line: [code=php:0]upload_max_filesize = 2M[/code] Change 2M to 8M or whatever max file upload size you want. Save the php.ini and restart the server. The upload limit should now of changed.