1,376 Posted Topics
Re: It was really buggy but I think I found all the bugs. Below is the corrected code. [CODE=php]<?php //Display this page $places = 700; ?> <html> <head><title>Fix this script</title> <style type='text/css'> <!-- table { margin-left: 3em; padding: 5; } td { padding: .1in .25in .1in .25in; } h2,h3 { font-weight: … | |
Re: I received that error when calculating pi. As for the solution: There may be a line like the below in the php script. [CODE=php]ini_set('memory_limit','32M');[/CODE] To solve that line simply change the number to how many megabites you want allocated to the memory. That is if the line exists somewhere in … | |
Re: [QUOTE=jlasker;900147]I'm just wondering if using mail() is the best way to go for this purpose or if I need to use something like phpmailer or other classes out there.[/QUOTE] Well the mail() function is for sure one of the easiest ways to go unless you have a corrupted mail server. … | |
Re: As mentioned in the [URL="http://www.daniweb.com/forums/thread191031.html"]Faq[/URL], the common problem that I use to have was that no results were returned. So try adding the following if statement around the while loop: [CODE=php]$r = mysql_query('SELECT * FROM `table`') or die(mysql_error()); if (mysql_num_rows($r)>0) { while ($row=mysql_fetch_array($r)) { echo $row[0].'<br>'; } }[/CODE] Also make … | |
Re: Could you be a bit more clearer on what you want done because the description is a bit patchy. From what I can understand, you have a variable somewhere and you want to append it to the current url. I think the following php script would do that if the … | |
Re: The easiest of all things is a search engine bot. I've made several of them before and are really easy to make with impressive results if you have enough cpu. | |
Re: When combining tables to make one big table, you need to have a common column to pair with which in your case appears to be the column named "code". A tutorial can be found at [URL="http://www.tizag.com/mysqlTutorial/mysqljoins.php"]http://www.tizag.com/mysqlTutorial/mysqljoins.php[/URL] and below is a query example: [CODE=mysql]SELECT * FROM fruit, cart WHERE fruit.code = … | |
Re: Also your function has a big security hole. Try using mysql_real_escape_string() on all mysql input. Below is an example: [CODE=php]function mcheckTime($ip,$a){ $a=mysql_real_escape_string($a); $ip=mysql_real_escape_string($ip); $myDb = new myDb; $myDb->connect(); $sql = "SELECT * FROM cpmip WHERE ip='$ip' and adid='$a'"; $res = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($res); $myDb->close(); $time = time(); … | |
Re: Do you mean that you want to convert all your php documents into html documents or are you trying to place php content under a .html extension. If you are trying to convert all the php documents to html documents then the following script will do the job although you … | |
Re: The form needs to surround the outside of the table. Below is a fixed up version: [CODE=html]<?php if ($_POST['Submit'] == 'Submit') { print_r($_FILES) ; } ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript"> function addFileInput() { var … | |
Re: Well most of the good ones you need to pay for but just for the basics, Pobs does the job and can be found at: [URL="http://pobs.mywalhalla.net/"]http://pobs.mywalhalla.net/[/URL]. I've used it in the past it works great providing you read the manual. | |
Re: Perhaps the email is being classified as spam or maybe theres a bug in your code. Try posting the code you used for the 10 emails for us to check for bugs. Note that you may want to replace the email address with fake ones in the sample code you … | |
Re: [B]Edit: [/B]Sorry but I was typing this when adatapost beat me to the answer by seconds. Simply use action="test.php" in the <form> tag. Below is an example: [CODE=html]<form method="post" action="test.php"> <input type="text" name="mobile" id="mobile" /> <input type="submit" value="send"></form>[/CODE] Then in test.php, to display the value use the following [CODE=php]$mobile=$_POST['mobile']; //retrieves … | |
Re: According to the [URL="http://dev.mysql.com/doc/refman/5.4/en/select.html"]mysql manual[/URL] which has no mention of left join, it would be one of the following: [CODE=php]mysql_query( "SELECT c.category_id,c.category_name,photo_filename,COUNT(photo_id) FROM gallery_category as c WHERE user='$user' LEFT JOIN gallery_photos as p ON p.photo_category = c.category_id GROUP BY c.category_id" );[/CODE] or [CODE=php]mysql_query( "SELECT c.category_id,c.category_name,photo_filename,COUNT(photo_id) FROM gallery_category as c LEFT … | |
Re: If you mean to copy the contents of a text file into a webpage then the file_get_contents() function should do the trick. Below is an example: [CODE=php]<? $data=file_get_contents('filename.txt'); //get data from file $dat=explode("\r\n",$data); //split data at new lines echo '<table border=1 cellpadding=3 cellspacing=0>'; foreach ($dat AS $val) { //loop echo … | |
Re: [QUOTE=Tulsa;897462]hi you can also call the css file as like this in php.... where no need of echo function for <link> tag [code] <?php $link = $_POST['fs']; ?> <link rel='stylesheet' href='<?=$link?>'> [/code] Thanks[/QUOTE] That sometimes causes problems on some servers and would need to be replaced with the following: [CODE=php] … | |
Re: I have just done a yahoo search to see if there were any databases online available for download and could not find a single one. So it appears that there are three ways of getting the data into your website they are: [LIST=1][*]To spend hundreds of dollars making a deal … ![]() | |
Re: I would say that your program has changed the universal sound preferences. This can be found on the start menu at: Start --> All Programs --> Accessories --> Entertainment --> Volume Control. Then check that all of the sound meters as set to at least half way. | |
Re: [CODE=php]$to=stripslashes($_POST['to']); if($to == '1'){ mail($email, $subject, $message, $headers); }else { mail($email, $subject, $message, $headers); }[/CODE] Above is an example and for further reading the mail function manual is at [URL="http://au2.php.net/function.mail"]http://au2.php.net/function.mail[/URL] | |
Re: Although I haven't bothered making custom 404 pages in the past, I would suggest placing the admin section in a separate directory with is own .htaccess rules for 404 error reporting while all other directories have a different .htaccess file pointing to the custom 404 error page. I've read things … | |
Re: Try making your php page the following: [CODE=php]<?php echo 'The email you entered is '.$_POST['email'].'.'; echo 'The password you entered is '.$_POST['pswd'].'.'; ?>[/CODE] And other than that your code should be fine unless there is other code in the php file that may be causing the problem. | |
Re: So many questions to answer so here are the answers [QUOTE]Are you using just php in your work?[/QUOTE] No, I like to use a wide variety of languages including C++, Java, html, css, Ajax, php and javascript. [QUOTE]Are you using a templating system like Smarty?[/QUOTE] If you mean a content … | |
Re: Perhaps you are using the wrong ip address to remotely access the data. To find out what ip address to put into the browser url to view your pages, first go onto your server computer. Then click start->Run->Type: "cmd" (without the quotes) Then in the command box type "ipconfig" without … | |
Hi, I'm looking for an open source c++ compiler to embed into an ide project I'm working on. I'm using Visual C++ express 2008 and would like to know what you's recommend as I have heard of gcc and MinGW but don't know what is best and EASIEST as they … | |
Hi, I have been learning some c++ with a friend and saw a [URL="http://www.youtube.com/watch?v=nY8z5Eh-kcg&NR=1"]youtube video[/URL] where there were some features I just couldn't find in my version (express edition). I have to ask in which version of Visual Studio 2008 does the Project type [I]Windows Forms Application[/I] appear in where … | |
Re: I think what you are looking for is .htaccess files which is part of the apachie rewrite module. With .htaccess files, you can make fake urls that on the server side rewrite to the real file. [CODE]Example - real url: site.com/index.php?username=cwarn23&id=blog Fake url: site.com/cwarn23/blog/[/CODE] I would provide some code but … | |
Re: I would suggest using sessions to check what stage the user is at then make php exit the script with a message if the user has viewed a page in the wrong order. Below is an example: [CODE=php]<? session_start(); //page1.php $_SESSION['pagestatus']=1; ?> <a href='page2.php'>Next page</a>[/CODE] [CODE=php]<? session_start(); //page2.php if ($_SESSION['pagestatus']!==1) … | |
Re: [QUOTE]http://listhoster.net/scratch/images/prize_th_%3C?=$prize[%27id%27];%20?%3E.jpg[/QUOTE] It appears you have incorrectly connected an array to a string. Without the code that echos that line I can only guess but I would say that line would look something like the following: [CODE=php]<?php echo 'http://listhoster.net/scratch/images/prize_th_'.$prize['id'].'.jpg'; ?>[/CODE] And the above will return something like the below: [CODE]http://listhoster.net/scratch/images/prize_th_variable.jpg[/CODE] | |
Re: All fixed. Try this: [CODE=php]<?php $url = $_GET['DLURL']; // Fetch page $string = FetchPage($url); // Regex that extracts the urls from links $links_regex = '/\<a[^\/\>]*'. 'href=["|']([^javascript:].*)["|']/Ui'; preg_match_all($links_regex, $string, $out, PREG_PATTERN_ORDER); echo "<pre>"; print_r($out[1]); echo "</pre>"; function FetchPage($path) { $file = fopen($path, "r"); if (!$file) { exit("The was a connection error!"); … | |
Re: Although I don't know much about SSL certificates, I would say that its more likely to be related to the apachie httpd.conf file instead of the php.ini Also, if you have cpanel installed then I think you might be able to do most of the work through the cpanel interface. … | |
Re: Would this code do the trick? [CODE=php]<? $array = array("amit", "hello", "amit", "world", "hello"); /* Sort into an array */ $i=0; foreach ($array AS $value){ $result[$value][]=$i; $i++; } /* Dump Result */ echo '<xmp>'; print_r($result); echo '</xmp><hr>'; /* Display Results */ foreach ($result AS $name=>$var) { echo $name.' '; foreach … | |
Re: There are a few bugs and security holes in that script. So try the following: [CODE=php] mysql_connect(" ") ; //add variables in function mysql_select_db(" "); //add variables in function if(!empty($_GET["c"]) && !preg_match('/[^0-9]/',$_GET['k'])) { $k = $_GET["k"] ; $cnt = $k; $k += 3; } else {$cnt = 0; $k = … | |
Re: Also, you may want to note that the following script commonly used will cause an error on some servers: [CODE=php]//mysql connections $result=mysql_query('SELECT * FROM `table`'); while ($row=mysql_fetch_array($result)) { echo 'test didn't work. There shouldn't be any rows in the table.'; break; }[/CODE] Instead the following should be used: [CODE=php]//mysql connections … | |
Re: Simply use the explod function to convert the string into an array. So for your example, the following code would apply: [CODE=php]$string="hyderabad,india"; $strings=explode(',',$string); echo $strings[0]; // outputs: hyderabad echo "<br>"; // new line echo $strings[1]; // outputs: india[/CODE] | |
Re: For sms and php you need to sign up to a subscription with a sms provider and a simular thread is at [URL="http://www.daniweb.com/forums/thread161220.html"]http://www.daniweb.com/forums/thread161220.html[/URL] An example php script is located at [URL="http://www.clickatell.com/developers/php.php"]http://www.clickatell.com/developers/php.php[/URL] but as for the rest of your question, mysql databases should be able to solve that. Just the sms … | |
Re: If you want to add the apostrophe then try this: [CODE]preg_replace("/[^`a-z,. '\-\d]/i", "", $height)[/CODE] | |
Re: I'm not sure what you mean by overhead but if you are meaning will it take more cpu and longer to load then yes is the answer. And is that a java class because they are meant to be called via html code and not php unless you have worked … | |
Re: Depending on your dictionary I am guessing you will need a numbered id field if there are non a-z0-9 characters. To solve this, the following script will automatically fill in the id field for you: [CODE=php]<? $username='admin'; //Mysql access username $password=''; //Mysql access password $database='mydatabase'; //Database to connect to - … | |
Re: Well just as another validator option, try making your php file the following: [CODE=php]<?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if (!empty($_FILES)) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please … | |
Hi, I have been trying to get the Jsapi (Java Speech API) embeded into my web applet but have had quite a few troubles. The script for the Jsapi from what I can see was designed for .Jav files where as I am trying to make a .class file. So … | |
Re: Try something like this: [CODE=php]<?php error_reporting(E_ALL); header("location: index.php"); include("conn.php"); $mode=$_GET["mode"]; if($mode=="add") { $MachineNo=$_POST["MachineNo"]; $MnfgDate=$_POST["MnfgDate"]; $PRD='tablename'; //make sure $RPD is assigned to the table name $sql="insert into $PRD(MachineNo,MnfgDate) values('". mysql_real_escape_string($MachineNo)."','".mysql_real_escape_string($MnfgDate)."')"; $result=mysql_query($sql) or die(mysql_error()); } elseif($mode=="update") { //use stripslashes if magicquotes are on. $MachineNo=stripslashes($_POST["MachineNo"]); $MnfgDate=stripslashes($_POST["MnfgDate"]); $sn=stripslashes($_POST["MnfgDate"]); $sql="update $PRD set MachineNo='".mysql_real_escape_string($MachineNo)."',MnfgDate='". mysql_real_escape_string($MnfgDate)."' where … | |
Re: [QUOTE]It has to be like divachix, please comment or send me a message if you are interested.[/QUOTE] If you are talking about [URL="http://divachix.com/"]http://divachix.com/[/URL] then it shouldn't be too hard for most parts to recreate and I can help with the php and javascript codes/scripts. You may also want to use … | |
Re: [QUOTE]$thumb_image = imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // displaying thumbnail $thumbnail = "<img src= ".$thumb_image.">";[/QUOTE] Try going to view source of the page and you will find that there is no image location specified. That is because you can't just dump an image to the … | |
Re: Try changing the if statement at the end of your script to the following: [CODE=php]if($row['user']=='' || !isset($row['user'])) { echo "No Access"; /*echo '<script type="text/javascript> document.validate.name.focus(); </script>';*/ } else { echo " Acces"; } ?> </body> </html>[/CODE] | |
Re: Hi BzzBee, I don't know about you but I prefer [URL="http://www.apachefriends.org/en/xampp-windows.html"]xampp[/URL]. Although I haven't tried wamp I find xampp really easy to make modifications to and it even has a status control panel. Although xampp and wamp are basically the same I guess it doesn't really matter which you choose … | |
Re: Do you mean like this: [CODE=php]//make sure this directory is writable! $path_thumbs ='c:/wamp/www/thumb'; //the new width of the resized image, in pixels. $img_thumb_width = 200; // $extlimit = "yes"; //Limit allowed extensions? (no for all extensions allowed) //List of allowed extensions if extlimit = yes $limitedext = array(".gif",".jpg",".png",".JPG",".JPEG",".jpeg",".bmp"); //the image … | |
Re: If you are trying to send php code to the file then perhaps it is better to use single quotes like the following so variables inside the string do not display their values: [CODE=php]$idhandle = fopen($filename, 'r+') or die("can't open file"); $id = '<?php $lastid = "$lastid"; ?>'; fwrite($idhandle, $id); … | |
Hi, I have been trying to find a way to get my databases on two external hard drives plus one internal hard drive but I just can't find a way to place each database on a separate drive. The only thing I have come across is windows junctions but can't … | |
Re: Yes I agree. How to confirm, the use of the [ICODE]->[/ICODE] symbol combination and also with the use of the terms [ICODE]public function[/ICODE] and [ICODE]private function[/ICODE] | |
Re: Although I don't fully get how those 2 scripts merge I can tell you now that you should never store the raw password in a cookie. Instead you should hash it or use sessions like you've suggested. To use sessions it is really really easy. Using sessions is like using … |
The End.