1,376 Posted Topics
Re: First welcome to daniweb as I see your a new poster. Second, please don't bump really old topics again as it can be really annoying at times. Especially for those who have subscribed to the thread. And as for the answer, in your /mg2/ directory place a htaccess file with … | |
Re: [QUOTE=mundetas;998597]'check-box-1' thats the name of the check box right.[/QUOTE] From my experience yes it is. | |
I have noticed that since the upgrade, when previewing the text that we are about to post, the previewed text is smaller than it should making the number of words per line misleading and at times hard to read. Also in this same preview area, code boxes with a line … | |
Re: Try this: [CODE=php]<form method="post">Scan site: <input type="text" name="site" value="http://" style="width:300px"> <input value="Scan" type="submit"></form> <? set_time_limit (0); if (isset($_POST['site']) && !empty($_POST['site'])) { /* Formats Allowed */ $formats=array('html'=>true,'htm'=>true,'xhtml'=>true,'xml'=>true,'mhtml'=>true,'xht'=>true, 'mht'=>true,'asp'=>true,'aspx'=>true,'adp'=>true,'bml'=>true,'cfm'=>true,'cgi'=>true, 'ihtml'=>true,'jsp'=>true,'las'=>true,'lasso'=>true,'lassoapp'=>true,'pl'=>true,'php'=>true, 'php1'=>true,'php2'=>true,'php3'=>true,'php4'=>true,'php5'=>true,'php6'=>true,'phtml'=>true, 'shtml'=>true,'search'=>true,'query'=>true,'forum'=>true,'blog'=>true,'1'=>true,'2'=>true, '3'=>true,'4'=>true,'5'=>true,'6'=>true,'7'=>true,'8'=>true,'9'=>true,'10'=>true,'11'=>true, '12'=>true,'13'=>true,'14'=>true,'15'=>true,'16'=>true,'17'=>true,'18'=>true,'19'=>true, '20'=>true,'01'=>true,'02'=>true,'03'=>true,'04'=>true,'05'=>true,'06'=>true,'07'=>true, '08'=>true,'09'=>true,'go'=>true,'page'=>true,'file'=>true); function domain ($ddomain) { return preg_replace('/^((http(s)?:\/\/)?([^\/]+))(.*)/','$1',$ddomain); } function url_exists($durl) { // Version 4.x supported $handle = … | |
Re: Try uncommenting line 33 where you have commented the function mysql_query(). Also try replacing the $_SERVER['REQUEST_METHOD'] with the following: [CODE=php]if (isset($_POST) && !empty($_POST)) {[/CODE] | |
Re: Why won't that work. Is there something in the included library that prevents it working. The only thing I would suggest is escaping the variable $key like the following:[CODE=php]$zips = $z->get_zips_in_range("".$my_zip."", "".$distance."", _ZIPS_SORT_BY_DISTANCE_ASC, true); foreach ($zips as $key => $value) {} $key=mysql_real_escape_string($key); $sql="SELECT * FROM users WHERE zip='$key'"; //<-- should … ![]() | |
Re: This is from the top of my head but try something like this: [CODE=php]<div style="width:100%;height:500px;scrollbars;border-style:solid;overflow:no;overflow-Y:auto;background-color:#FFFFFF;border:1px;border-color:#AAAAAA;"> <?php echo file_get_contents('http://www.yoursite.com/file.php'); ?> </div>[/CODE] Also in the file your embedding, do not have any body or head tags in the included file. So in the example above, file.php would have no body tags and … | |
Re: lol, Ordering a gun from the menu in the macdonalds drive through. | |
Re: Perhaps this might be better: [CODE=php]mail($to, $subject, $body, "From: Mr. User <user@site.com>\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/alternative;\r\n" . " boundary=" . $mime_boundary_header."\r\n") or die('Mail Error');[/CODE] | |
Re: Although I myself haven't really played with this feature, the problem is the server time does not match your local time. In other words the server is in a different timezone to where you live. To solve this read the first few screens on the page at [URL="http://www.php.net/manual/pl/function.date-default-timezone-set.php"]http://www.php.net/manual/pl/function.date-default-timezone-set.php[/URL] | |
Re: [CODE=php]$num_rows = CountRecords("SELECT * FROM ".TBL_CREDITS." WHERE user_id = $user_id"); if($num_rows >0){ $result = selectFrom("SELECT * FROM ".TBL_CREDITS." WHERE user_id = $user_id");[/CODE] Try replacing the above lines of code with something like the following: [CODE=php]$num_rows = CountRecords("SELECT * FROM `credits` WHERE user_id = '".mysql_real_escape_string($user_id)."'"); if($num_rows >0){ $result = selectFrom("SELECT * … | |
Re: There are several solutions to this problem. You could modify your php.ini file to allow php short tags. Or if you don't have access to the core php.ini file you can add the following code to the very top of your document. [CODE=php]<?php ini_set('short_open_tag',1); ?><?[/CODE] | |
Re: I did a google search and the following link might be of great interest to you. [URL="http://www.m6.net/"]http://www.m6.net/[/URL] Enjoy. ![]() | |
Re: To retrieve the variable param from the url simply use $_GET['param'] to get its value. | |
Re: Try the following: [CODE=php]$data='<table width="100%"> <tr> <td align="center"> <b> <h1 class="title_list">$$FullName$$</h1> </b> <br><br> </td> </tr> <tr> <td>$$FirstName$$ is a $$Gender$$.</td> </tr> </table>'; $data=str_replace(array('$$FirstName$$','$$Gender$$','$$FullName$$'),array('Bill','Male','Bill Gates'),$data); echo $data;[/CODE] | |
Re: I just love making bots. You can view my article at: [URL="http://www.syntax.cwarn23.info/PHP_Making_a_search_engine"]http://www.syntax.cwarn23.info/PHP_Making_a_search_engine[/URL] The script is as follows:[CODE=php]<form method="post">Scan site: <input type="text" name="site" value="http://" style="width:300px"> <input value="Scan" type="submit"></form> <? set_time_limit (0); if (isset($_POST['site']) && !empty($_POST['site'])) { /* Formats Allowed */ $formats=array('html'=>true,'htm'=>true,'xhtml'=>true,'xml'=>true,'mhtml'=>true,'xht'=>true, 'mht'=>true,'asp'=>true,'aspx'=>true,'adp'=>true,'bml'=>true,'cfm'=>true,'cgi'=>true, 'ihtml'=>true,'jsp'=>true,'las'=>true,'lasso'=>true,'lassoapp'=>true,'pl'=>true,'php'=>true, 'php1'=>true,'php2'=>true,'php3'=>true,'php4'=>true,'php5'=>true,'php6'=>true,'phtml'=>true, 'shtml'=>true,'search'=>true,'query'=>true,'forum'=>true,'blog'=>true,'1'=>true,'2'=>true, '3'=>true,'4'=>true,'5'=>true,'6'=>true,'7'=>true,'8'=>true,'9'=>true,'10'=>true,'11'=>true, '12'=>true,'13'=>true,'14'=>true,'15'=>true,'16'=>true,'17'=>true,'18'=>true,'19'=>true, '20'=>true,'01'=>true,'02'=>true,'03'=>true,'04'=>true,'05'=>true,'06'=>true,'07'=>true, '08'=>true,'09'=>true,'go'=>true,'page'=>true,'file'=>true); function domain … | |
Hi and I have just noticed with my media wiki installation that all of my pictures in mediawiki are suddenly broken. The files are there but if I enter the path location in the url bar it takes infinit time to load (never loads - no error). Same for in … | |
Re: I say both. [URL="http://religiousfreaks.com/2006/07/09/evolution-vs-creationism-family-guy-style/"]This video by family guy tv series[/URL] shows it right from the big bang. | |
Re: I wouldn't miss either because i'm infront of a computer most of the day where I can get music via internet+itunes and if I need to make a phone call I can simply make a free sms (I think) message through gmail. | |
Re: Try the following code: [CODE=php]<style type="text/css"> A:link {font-weight:bold; font-family:"Arial";} A:visited {font-weight:bold; font-family:"Arial";} A:active {font-weight:bold; font-family:"Arial";} A:hover {font-weight:bold; font-family:"Arial";} </style> <? $number_of_pages=100; //maximum number of pages $current_page=50; //set the current page probably with $_GET for ($i=1;$i<=$number_of_pages;$i++) { if ($i<11) { echo ($i>1)? ' - ':''; // add dash between numbers. echo … | |
Re: No error. That's because you didn't echo the exec function. Line 18 should be as follows: [CODE=php]echo exec($createBackup);[/CODE] | |
I'm not sure if this is possible but I'm kinda stuck in the middle. For my script I need to calculate the server load and the mysql cache usage both in percentage. Does anybody know of any scripts I can use for this. There are probably open source things that … | |
Hi and I am looking for a compression mechonism that can compress text (just letters and numbers) into binary or all weird symbols. Does anybody know of any good php/mysql codes as I can't get any to work. | |
Re: Well I would recommend an advanced system of ajax for best confirmation but if you want to keep it simple the following script will do the job. [CODE=php]$v=get_browser(null,true); $javascript=$v['javascript']; unset($v); if ($javascript) { echo 'Javascript is enabled'; } else { echo 'Javascript is disabled'; }[/CODE] | |
Hi and in a previous discussion I wrote a bot that created informational text articles from the php forum at daniweb. This discussion can be found at [URL="http://www.daniweb.com/forums/thread200918.html"]http://www.daniweb.com/forums/thread200918.html[/URL] However I now have another question due to the great success of my bot. Is it possible for to expand the bot … | |
Re: Perhaps a login table like the following: [CODE]Username [B]|[/B] password | use_admin cwarn23 | abcdefg9 | 1[/CODE] The above structure has the username then the normal login password. After that is the value for logging into the admin account. So each user with the value 1 in use_admin can log … | |
![]() | Re: I would suggest trying the following 3 functions: [CODE=php]array_multisort() arsort() asort()[/CODE] I can't tell for sure which one or if any will work because there isn't an example for me to test. ![]() |
Re: [QUOTE]if( !@include( $path ) ) {[/QUOTE] That part of the syntax is totally wrong. I don't think that an include is not meant to be in an if statement. Also replace the include with the require function which does the same thing but with error reporting. Also I would advice … | |
Re: As faster as daniweb may seem the daniweb pages source code looks a lot cleaner around the headers. | |
Hi and I have been looking around and found that google has a few search api's but haven't yet found one that returns the results as a javascript/ajax array. Is it possible to at least get the google api to send the results to my website as a variable/array in … | |
Re: [QUOTE]echo "<form action=http://www.romancart.com/cart.asp method=post>\n"; echo"<input type=\"hidden\" name=\"itemname\" value=\"$m_id\">"; echo'<input type= hidden name=returnurl value="http://217.146.126.103/passenger.php">'; echo"<input type=\"hidden\" name=\"price\" value=\"$p_id\">"; echo"<input type=\"hidden\" name=\"storeid\" value=\"45983\">";[/QUOTE] The above quote should turn into the below code: [CODE=php]echo '<form action="http://www.romancart.com/cart.asp" method="post">'."\n"; echo '<input type="hidden" name="itemname" value="'.$m_id.'">'; echo '<input type="hidden" name="returnurl" value="http://217.146.126.103/passenger.php">'; echo '<input type="hidden" name="price" value="'.$p_id.'">'; echo … | |
Re: [QUOTE=darkagn;983163]Also, make sure that you never send unencrypted passwords via GET as they will be visible in the URL. There are also hacking tools which allow the retrieval of POST data, so watch out for that too.[/QUOTE] Even better yet, use javascript to encrypt the passwords before sending it over … | |
Re: Well for starters you can visit the [URL="http://www.tizag.com/phpT/"]tizag[/URL] and my website. Also let me know what you think of my site. | |
Re: Try the following: [CODE=php]<form action="search.php" method="POST"> Search: <input type="text" name="search" style="width:300px;"> <input type="submit" value="Search"> </form><? if (@$_POST['search']==""){ echo "What are you doing?"; } else{ $query = file_get_contents("http://www.google.com/search?q=".urlencode($_POST['search'])."&num=100&hl=en&ie=UTF-8&filter=2"); //needs to be added with more queries $replace_array = array('/\n/','/<head>(.*)<\/head>/','/(.*)<div id=res>/','/<br clear=all>(.*)/','/(.*)\<h2 class\=hd\>Search Results\<\/h2\>/'); //pregraplacing unneeded parts $results = preg_replace($replace_array, '', $query); echo … | |
Re: I'm not sure but it might be an idea to remove the [nc] The [nc] stuff is for advanced users mainly. Also yes it does work but both ways will work. So basically if you link to the htm version then it should work just as well as if you … | |
Re: [QUOTE]Im working on a project at present where i need to be able to upload a batch of apporx 400 files each week.[/QUOTE]I hope it's not a windows server your using because when I attempted to create over 500,000 folders and subfolders with php, it crashed the external hardrive and … | |
Re: Don't use Bing! Microsoft has put a word sensor on Bing and made deals with different goverments for what results should come first. That is where Bing got a lot of it's money from for setting up - the goverments decision to sensor what they want where they want. | |
Re: I would suggest that if your very experienced in php then it is by far best to write your own starting from a template. The template I would recommend is the [URL="http://www.microsoft.com/downloads/details.aspx?FamilyId=E565FC92-D5F6-4F5F-8713-4DD1C90DE19F&displaylang=en"]Microsoft PHP MSN Messenger Online[/URL] Open Source Template. With this users can log into your chatroom using their regular … | |
Re: Perhaps the following: [CODE=php]//get username $username='Bill Gates'; //validate $username=mysql_real_escape_string($username); //set the sql query $result=mysql_query('SELECT * FROM `table` WHERE `usercolumn`="'.$username.'"'); //check if it exists if (mysql_num_rows($result)>0) { //it exists } else { //it does not exist }[/CODE] | |
Re: The way I found best is by putting a dot between the [b].[/b] tags. So the following is an example of what your code should have looked like: [code][B].[/B]/calcAverage 5 8 1 4[/code] | |
Re: [QUOTE=DealthRune;984703]I changed it's value to On, but it still doesn't work.[/QUOTE] Well a server can have several php.ini files and only one of them are really used. So make sure the php.ini file you changed is the same one as listed when you use the following code: [CODE=php]<?php phpinfo(1); ?>[/CODE] … | |
Re: Try this: [CODE=php]$sql = 'INSERT INTO jow (jokes_id, date_added, date_end)'; $sql .= ' VALUES('; $sql .= $jokes_id . ',' ; //$sql .= '1545 ,'; //$sql .= ', 5, '; $sql .= ' now(),'; $sql .= '"'.$next_monday.'"'; $sql .= ',)'; echo $sql . '<BR>';[/CODE] According to your commented sql columns there … | |
Re: Try this: [CODE=php]setcookie('user','',(time()-(60*60*24)));[/CODE] Also make sure that code is before any html output. | |
Re: Well first open the image file itself while on the server with the problem and it should say what line the bug is in. A possible bug is the imagecreatefromgif() file location being different and another possibility is the gd library not being installed. | |
Re: Generally to use php on a server you need to download apache and php itself. However if you plan to install apache and php on your local computer then it is by far easier to download wamp. A google search will find you wamp. Also note that there is xampp … | |
Re: Well I know there are 4 types of outputs for a function. [CODE]Array Result Object String [B].[/B][/CODE] Could you describe more of what your question is exactly because it's very brief. | |
Re: xan is right and the code for it is something like the below. First in your form add the following code: [CODE=html]<input type="hidden" value="" name="js" id="js">[/CODE] Then to update its value in the javascript function use the following javascript: [CODE=html]<script> document.getElementById("js").innerHTML="new value"; //or document.getElementById("js").value="new value"; </script>[/CODE] | |
Re: Well if you want the page to refress every 15 seconds then there is nothing php can do about that. However you could use a mixture of Ajax and php for this job but Ajax is just like Javascript. Sorry if this isn't the answer you wanted. | |
Re: If you mean what type of forum digital point uses it appears it uses something like phpbb or at least has a simular interface. | |
Re: Try this: [CODE=php]<? $string='Sign up for Facebook to connect with Jean Profession'; $word=explode(' ',$string); $b=(count($word)-1); $b=mt_rand (0,$b); echo $word[$b]; ?>[/CODE] |
The End.