wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
You'll have to let mod_rewrite set your $_GET variables, rather than PHP (which means dropping your mod_rewrite function). So your mod_rewrites will become RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # matches: item/fancydress/125/theitemtitle.html RewriteRule /([a-z]+)/([a-z]+)/([0-9]+)/([a-z]+)\.html index.php?page=$1&type=$2&id=$3&item=$4 [NC,L] # matches: item/fancydress/theitemtitle.html RewriteRule /([a-z]+)/([a-z]+)/([a-z]+)\.html index.php?page=$1&type=$2&item=$3 [NC,L] # matches: item/fancydress.html RewriteRule /([a-z]+)/([a-z]+)\.html index.php?page=$1&type=$2 [NC,L] Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^mydomain.co.uk [nc] rewriterule ^(.*)$ http://www.mydomain.co.uk/$1 [r=301,nc]
-
To send an email with PHP you'd use mail
-
Help with mysql_fetch_array result and error message
wildteen88 replied to Darkmatter5's topic in PHP Coding Help
Normally with that error it means there was a problem with your query, you can find out whether this true or not by changing $result=mysql_query($query); to $result=mysql_query($query) or die($query . '<br >'.mysql_error()); Also I cannot see how $byrndb->client_list(2,$row['client_id']); has any reference with the code you posted. -
If your url is always going to like page/type/id/item.html then yes, however if your url varies then no. Is you url always going to be in the above format?
-
Time out by one hour in the future
wildteen88 replied to stockton's topic in PHP Installation and Configuration
I don't think PHP supports SAST, here is a list of supported time zones. Your may have to set the time zone to one of the supported African timezones. -
Not able to run script from command line
wildteen88 replied to stockton's topic in PHP Installation and Configuration
The image you provided in your post needs to be uploaded to your site, you cant link files to your computer and expect us to see it. How have you installed/setup PHP? From what I found on google it is to do with PHP trying to load extensions which doesn't exist, this is normally due to PHP not being configured correctly. -
It would be helpful if you provided the error message(s) you get in full here.
-
Check your servers error log, the reason for the error will be logged there. Also you'll need to make sure the file world8.txt has write permissions (chmod 755 should do it). I am also amusing you're running php5, as file_put_contents is only available for PHP5. You can check the version of PHP by running phpversion() function.
-
array_unique
-
WHat that! What's supposed to be encoded? The file url or the contents of the file? If its the contents of the file then its <?php $contents = file_get_contents("http://www.test.com/test.txt"); if(!empty($contents)) { $contents = urldecode($contents); file_put_contents("test.txt", $contents); } ?>
-
All PHP code (HTML can be placed in the file too) must be saved within a .php file, eg filename.php You wont be able to run .php files locally, unless you have the AMP stack installed.
-
How to hide file extensions using $handle = opendir
wildteen88 replied to lorne17's topic in PHP Coding Help
Change while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") to $ignore_files = array('.', '..', '.htaccess', '.htpsswd', 'index.php'); while (false !== ($file = readdir($handle))) { if (!in_array($file, $ignore_files)) EDIT: too slow ;)/b] -
I believe it used in conjunction with ZipArchive::open (look at flags).
-
No, your code needs to be <?php $contents = file_get_contents("http://www.test.com/test.txt"); if(!empty($contents)) { file_put_contents("test.txt", $contents); } ?> Do you mean it encoded using urlencode()? If so PHP has built function called urldecode() to decode the urlencode'd string.
-
That's because you should always check to see if user defined variables exist first before using them. Eg if((isset($_GET['act']) && $_GET['act'] == 'view') && (isset($_GET['id']) && is_numeric($_GET['id'])) { // variables are set, your code here } // variables are not set, display error else { die('You Have Reached This Page In Error!'); }
-
What is the file you're going to "download"? You could use file_get_contents, and then file_put_contents.
-
You have a space between Element_ and Tita, which is causing the error. $join = 'ALTER TABLE Element_'.trim($title).' ADD COLUMN ' . $input . ' VARCHAR(50)';
-
You should still verify that by running phpinfo, AddHandler application/x-httpd-php5 could be loading a different php.ini which has magic quotes enabled. Magic quotes has three different settings, which are magic_quotes_gpc - this is will automatically escape quotes in GET, POST or COOKIE data magic_quotes_runtime - this stetting will automatically escape strings returned from functions magic_quotes_sybase - allows you to escape quotes as '' (two single quotes) rather than \' (rarely used). Both of the above settings should be disabled.
-
You'll need to post more code. What are you trying to do and explain whats stored in the arrays ($array an $multiarray)
-
I didn't mention this earlier however you menu would be better of being done as a CSS menu, rather than a table. Here is some great examples of CSS menus.
-
The form submits to calc.php, however in calc.php you include calc.php! Whats that about? Doing that could cause an infinity loop and thus the error you get. EDIT: This is how I'd do it: <?php if(isset($_POST['submit'])) { $num1 = $_POST['num1']; $num2 = $_POST['num2']; switch($_POST['func']) { case 'sub': $num3 = $num1 - $num2; $sum = "$num1 - $num2 = $num3"; break; case 'mul': $num3 = $num1 * $num2; $sum = "$num1 * $num2 = $num3"; break; case 'div': $num3 = $num1 / $num2; $sum = "$num1 / $num2 = $num3"; break; case 'add': default: $num3 = $num1 + $num2; $sum = "$num1 + $num2 = $num3"; break; } echo "<b>Solution</b>"; echo "<br>"; echo $sum . '<hr />'; } include 'calc.html'; ?>
-
What is $bin? Is it a form field, a url variable, Session variable or what? if its either of the above then $bin should be in superglobal form, eg $_POST['bin'] or $_GET['bin'] or $_SESSION['bin'] etc. $bin will only work if register_globals is enabled. This setting is disabled by default as it is depreciated and is being removed as of PHP6.
-
For a simple two column layout like that you should not have to apply any sort of CSS hacks. I have I attached my version of your site with valid HTML/CSS. From my testing it works fine with FF3, IE7 and Safari 3. It should also work with other browsers such as FF2, Opera. It should work fine under IE6 too. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Qdos Consulting SA design</title> <link rel="stylesheet" type="text/css" href="qdos.css" /> </head> <body> <div id="container"> <div id="header"><img src="banner.jpg" alt="Qdos Consulting SA design" /></div> <div id="menu"> <table style="padding-top: 2px;" border="0" cellpadding="2" cellspacing="2" width="575"> <tbody> <tr> <td><a class="menulinks" href="#">Home</a></td> <td>|</td> <td><a class="menulinks" href="#">Products</a></td> <td>|</td> <td><a class="menulinks" href="#">News</a></td> <td>|</td> <td><a class="menulinks" href="#">Newsletters</a></td> <td>|</td> <td><a class="menulinks" href="#">Frequently Asked Questions</a></td> <td>|</td> <td><a class="menulinks" href="#">Contact Us</a></td> </tr> </tbody> </table> </div> <div id="content"> <div id="left"> <h3>Heading</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </div> <div id="right"> <div class="itemhead"> <h3 class="rightheading">Heading</h3> </div> <div class="itemmid"><p>solds is not the one to be sold without the other.</p></div> <div class="itemfoot"></div> <div class="itemhead"> <h3 class="rightheading">Heading</h3> </div> <div class="itemmid"><p>solds is not the one to be sold without the other.</p></div> <div class="itemfoot"></div> <div class="itemhead"> <h3 class="rightheading">Heading</h3> </div> <div class="itemmid"><p>solds is not the one to be sold without the other.</p></div> <div class="itemfoot"></div> <div class="itemhead"> <h3 class="rightheading">Heading</h3> </div> <div class="itemmid"><p>solds is not the one to be sold without the other.</p></div> <div class="itemfoot"></div> </div> </div> <div id="footer"></div> </div> </body> </html> * { padding: 0; margin: 0; } body { background:#F2E71C; color:#014782; font-family:Arial, Helvetica, sans-serif; font-size: 13px; background:#F2E71C url(bg.jpg) repeat-x; } #container { width:800px; margin: 0px auto; background:#014782 url(ee.jpg) repeat-y; } #header { background-image: url(dd.jpg); background-repeat: no-repeat; padding-top: 20px; text-align: center; } #menu { background:url(menu.jpg) no-repeat; height:29px; margin: 0 5px; padding: 0 5px; font-size:15px; } #menu .menulinks { font-weight:bold; text-decoration:none; cursor:default; color:#014782; } #content { padding: 10px; } #left { float: left; width: 540px; text-align: justify; line-height: 1.2em; } #left h3 { font-size:16px; padding: 0; } #left p { margin: 3px 0; text-indent: 1em; } #right { float: right; width: 180px; } .itemhead { background:#FFFFFF url(itemhead.jpg) no-repeat; height:42px; text-align:center; color:#FFFFFF; } .rightheading { padding-top: 8px; font-size:16px; font-weight:bold; } .itemmid { background:#FFFFFF url(itemmid.jpg) repeat-y; padding: 0px 17px 0px 5px; text-align:justify; } .itemfoot { background:#FFFFFF url(itemfoot.jpg) no-repeat; height:16px; padding-bottom:15px; } #footer { background:url(ff.jpg) no-repeat; height:22px; clear: both; }
-
Where is the variables $id and $bin set? What are you trying to do.
-
Changing .php files to .xxx and accessing it
wildteen88 replied to d.shankar's topic in PHP Coding Help
Then you'll have to change them manually yourself, mod_rewrite wont change the links in your page for you.