wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
You have restarted xampp after making the change? Also make sure you are editing the http.conf file in xampp/apache/conf/ Another suggestion is make sure there is not an # symbol in front of the line you are editing. Apache will ignore lines that begin with # symbols these lines will be classed as comments. You must remove the # from the beginning of the line in order for Apache to read that line.
-
You can change that by editing the ServerAdmin directive which is located around line 137 in the httpd.conf
-
[SOLVED] Making a Clickable Link from a Variable
wildteen88 replied to JSHINER's topic in PHP Coding Help
You will want to use regular expressions using preg_replace. Have a search through the Regex Help forum. I'm pretty sure there has been question like yours already posted within that board. -
On line 35 you have this: header("Location: success.php"); That header statement is on its own and is not within any condition. So as soon as PHP gets to that line no matter whats going on in your script it is always going to redirect to success.php What you will want to do is place it within an if when a certain condition is met.
-
[SOLVED] Re-Compiling on windows box
wildteen88 replied to mrjcfreak's topic in PHP Installation and Configuration
You don't need to recompile PHP to add x feature into the default install. You only have to recompile if you are on a *nix based OS. With Windows you just have to get the extension file (php_<extension_name>.dll) and any third party libraries the extension may require. Then in your php.ini you just place the following into the extension list: extension=php_<extension_name>.dll -
What are you trying to do? Apache should not need configuring as it is already configured when you install Xampp. By default you save your php files in C:/xampp/htdocs
-
Look carefully as it is being closed On what line does it get closed? My PHP editor highlights matching pairs of curly braces. All braces match up apart from line 11.
-
Why dont you use $text within a WHERE clause letting MySQL do the comparison instead: <?php $query = "SELECT repNumber FROM salesrep WHERE repNumber='$text'"; $result = mysql_query($query) or die('Query failed: '.mysql_error()); // check that mysql returned a row // if it did there was a match if(mysql_num_rows($result) == 1) { echo $text . ' - Match Found'; } else { echo $text . ' - Match Not Found'; } ?>
-
Oh... Hhold on... Sorry I had a few typos in my mod_rewrite code. Try this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z0-9]+) user.php?userid=$1 [NC,L] I didn't test what I posted last time. The above should now work.
-
print is the same as echo ...
-
if you are starting your echo statement with double quotes you must escape any double quotes within your string. The same applies to single quotes too. So to echo out this: <p style="color: red;">Text</p> you'd use echo "<p style=\"color: red;\">Text</p>"; // OR // echo '<p style="color: red;">Text</p>'; Please re-read Daniel0 echo examples in this post
-
Have you restarted IIS?. Also make sure you have restarted Windows too when you added PHP to the path. I am not experienced with IIS.
-
Looks like your script requires regsiter_globals. register_globals is now depreciated and is being phased out as can cause security exploits within your code. register_globals allows you to use $string instead $_POST['string']. I would not recommend you to enable register_globals. What I would recommend you to do is to get an updated book which doesn't code with register_globals enabled
-
Yes PHP can connect to remove database servers. Just make sure the remote server allows connections from the internet. When you want to connect to the remote ms sql database you'll provide the ip address or the url to the remote mssql server, eg: $cnx = mssql_conncect('ip/url to database here', 'username', 'password);
-
[SOLVED] Getting a <P>aragraph without the <p> into MySQL?
wildteen88 replied to suttercain's topic in PHP Coding Help
\n and \r characters are there but they are invisible. Also you should use double quotes when you are using escape characters: <?php function nls2p($str) { return str_replace('<p></p>', '', '<p>' . preg_replace("#([\r\n]\s*?[\r\n]){2,}#", '</p>$0<p>', $str) . '</p>'); } ?> -
Check your servers error log. There is a problem with your .htaccess. Make sured you host allows you use mod_rewrite or they have the mod_rewrite Apache module loaded Also you should use $_GET rather than $HTTP_GET_VARS. $HTTP_*_VARS has been replaced by $_* Also when you go run user.php dont actually go to user.php you just do this: mysite.com/user_name_here Apache will then call user.php?userid=user_name_here without showing the file being called in address bar. This is how mod_rewrite works.
-
AFAIK those are correct. If you are unsure you can always create a table with two columns side by side, on of the side fills in the background using the name of the color, eg bgcolor="blue" whilst the other columns use a hex for the background color bgcolor="#0000FF That way you can visually compare the colour differences. Heres a few random colors picked. <style> td { height: 30px; text-align: center; } </style> <table border="0" cellspacing="3" cellpadding="0" width="500"> <tr> <td width="33%">COLOR</td> <td width="33%"></td> <td width="33%">HEX</td> </tr> <?php $colors = array( 'Blue' => '#0000FF', 'AntiqueWhite' => '#FAEBD7', 'Chartreuse' => '#7FFF00', 'DarkGreen' => '#006400', 'Fuchsia' => '#FF00FF', 'LightSeaGreen' => '#20B2AA' ); ksort($colors); foreach($colors as $color => $hex) { echo " <tr>\n "; echo '<td bgcolor="' . $color . '"></td>'; echo '<td>' . $color . '</td>'; echo '<td bgcolor="' . $hex . "\"></td>\n </tr>\n"; } ?> </table>
-
The problem is to do with line 11: if($trackid == 1) { There is no closing brace for that if. This is what is causing the error. Where is the closing brace supposed to go. from looking at your code it should go on line 218 which is this: <?php if($trackid == 1) { // line 218 ?>
-
what's required for to build a website in php by own PC.
wildteen88 replied to gautammysql's topic in PHP Coding Help
it depends on Apaches configuration. Have you installed an AMP package yet, I recommended a few in my last post. From memory of using the two packages above I think for AMP you save your files in C:/wamp/www and for xxamp it is C:/program files/xampp/htdocs When you want to run your .php files you'd open your web browser and go to http://localhost/script-name.php You can not run them by just double clicking on them, like you can with .html files. You must go to http://localhost to invoke the http server (Apache) in order for your PHP scripts to get parsed. -
When a user signs up you'd add all their info into the database then using 1 php page, call this user.php, which takes a url parameter called userid the userid holds the username which is passed to user.php like this: user.php?userid=Smarty then in user.php you use $_GET['userid'] to get the username from the userid URL parameter. Using that userid you'd query your database to fetch what ever information you want to be shown for that user. To get urls like this to work: mysite.com/Smarty You'd want to use mod_rewrite: RewriteEngin On RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z0-9]+)$ user.php?userid=$1 [NC, L]
-
I don't think extension_dir can take multiple folder paths, like include_path can. extension_dir can only take one file path which points to PHP's extension folder.
-
what's required for to build a website in php by own PC.
wildteen88 replied to gautammysql's topic in PHP Coding Help
To create your PHP scripts all you need is a basic text editor such as Notepad. PHP is a server side programming langauge your PC wont be able to understand what PHP is and so you cannot run it directly in the browser, like you can with a .html files for example. What you'll want to do install a server environment. Such as download Apache and PHP. Or if you are on windows you can download a pre-configured install of AMP (Apache, PHP and MySQL (a database)), such as wampserver.com For *nix based systems you can use XAMPP. That is the very basics.