1,376 Posted Topics
Re: [QUOTE=steve345;812422]I already did that, but unsuccessfully, the code didn't work anymore.. could you help me step by step? Steve[/QUOTE] I think it is because the scripts you tried to merge allready had errors and merging them exploited the errors. Because notice the 2 script links you provided has errors reported … | |
Re: [QUOTE][CODE]while($row=mysql_fetch_array($quer)) { echo $row[uniqueid].") ".$row[stem]."<br>"; $qid= $row[uniqueid]; $sql1="select * from scale where uniqueid=$qid ;"; $quer1=mysql_query($sql1); while($row1=mysql_fetch_array($quer1)) { ?> <input type="<?php echo $row[type]; ?>" name="<?php echo $row[questionID]; ?>" value="<?php echo $row1[label]; ?>"> <?php echo $row1[label]; ?> <br> <?php } echo "<hr>"; }[/CODE][/QUOTE] I am unsure if this is solved but to … | |
Re: Try something like the following: [CODE=php]<? if (isset($_POST['tc_id'])) { $result=mysql_query("SELECT * FROM `table` WHERE `column`='".mysql_real_escape_string($_POST['tc_id'])."'"); $row=mysql_fetch_array($result); echo "<input type='text' value='".$row['column']."'><br>"; echo "<input type='text' value='".$row['column1']."'>"; } ?> <select name='tc_id'> Your existing select box here...[/CODE] | |
Re: Then if you do [ICODE]mysql_num_rows($b)[/ICODE] it will return 0 and if you attempt to fetch an array from the query then mysql will throw an error. So the value of b is still the query execute command but it just won't execute and instead will throw an error. | |
Re: Simply use the following: [CODE]$d=explode('&content=',$_post['data']); echo $d[0]; echo "<hr>"; echo $d[1];[/CODE] | |
Re: This topic really belongs in the Javascript forum but don't double post thought. Just remember that for next time. As for the javascript problem, it is Internet Explorer with the bug and not your script. This is because Internet Explorer has its own way of dealing with Javascript. To solve … | |
Re: I think the section for Government & Economics will get slower as we enter the global resession. But a very good link as I never knew any of those figures before. | |
Re: [QUOTE=!Unreal;813644]So would I do something like [code=mysql] SELECT FROM table1 WHERE column1='$foo' IN table1 WHERE column1='$foo2' [/code] Is that right? Just guess work :p[/QUOTE] For starters that mysql query is wrong and I shall share a way help answer this question. First to retrieve all [ICODE]site:[/ICODE] within a string use … | |
Re: Some code would be useful as I cannot see what needs to be changed. But if you are talking about iframes then you could use target='framename' | |
Re: [QUOTE=rohnni]i create a contact form that link to 5 pages , please help me to create a contact form using php..[/QUOTE] Well what seems to be the problem. Does it not function properly or are the errors reported. If so, what are the errors reported. Also I noticed your mail … | |
Re: I can tell you that when almostbob said contact paypal, he would have meant to perhaps send an email to the group named paypal or to contact the paypal group via online form. | |
Re: Do you meen something like [URL="http://au.php.net/manual/en/function.session-start.php"]sessions[/URL]. Sessions will allow you to pass variables between pages and are very simple to use. Simple place at the very top of your pages that use sessions the following code: [CODE=php]<? session_start();[/CODE] Then below is an example of how to use the session array: … | |
Re: Well I suppose you could try the different php encryption functions to see what works but if it is binary then there are no garrantees that it can be converted with php. Where-as if it is just jumbled up text then you can use the powerful php regex library to … | |
Re: What do you meen by saing "Outside of the folder". Because the example you gave shows everything you need to know to include/require a file. The ../ goes up one directory then the common/ goes down to the common directory then opens the dblayer.php. That simple. So is there anything … | |
Re: Try the following to destroy the session: [CODE=php]<?php session_start() include('includes/config.php'); $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> </HEAD> <BODY> <?php echo '<div class="nav">'.$navigation.'</div>'; ?> You have been logged out. </body> </html> [/CODE] | |
Re: Why not make the following your code: [CODE=php]$name = strtolower($_POST["name"]); $name = stripslashes(ucwords($name)); $email = strtolower($_POST["email"]); $emailx ="/^[a-z0-9]+([_.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\\.[a-z]{2,4}$/"; $alphaspace ="/^[a-zA-Z]+((['\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/"; if ($name=="") { $error. ="Name is a required field please complete and submit it again.|"; } elseif (preg_match($alphaspace, $name) ==false) { $error. ="Please fill in a correct value … | |
Re: Also if you want to learn the regex syntax the good old way then you can find the official documentation of the syntax at [URL="http://au2.php.net/manual/en/regexp.reference.php"]http://au2.php.net/manual/en/regexp.reference.php[/URL] You will find that the easiest way to learn is by starting with simple regex commands such as modifying existing ones then working you way … | |
Re: I couldn't exactly understand that description but the title is straight forward. So if you are meaning to have to pages but with the same contents just make the second page contain only the following: [CODE]<? include('firstpage.php'); ?>[/CODE] or even [CODE]<? echo file_get_contents("http://www.mysite.com/firstpage.php"); ?>[/CODE] | |
Re: Just simply add the html headers to the headers field. Below is a basic example: [CODE=php]// HTML headers $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //now to send it mail($to, $subject, $message, $headers);[/CODE] Hope it answers your question. | |
Re: I would suggest reading a few books and the [URL="http://www.tizag.com/phpT/"]tizag.com/phpT/[/URL] website has some basic tutorials. I would suggest getting use to the [I]if[/I] statement, variables, the echo statement, and $_POST + $_GET arrays. Perhaps you could for your first project create a html web form that posts the data to … | |
Re: The following line doesn't appear to follow the correct syntax: [CODE=php] $result = mysql_query('SELECT * from list WHERE title LIKE '%$search%' LIMIT ' . $offset . ',' . $limit);[/CODE] Try replacing it with the following: [CODE=php] $result = mysql_query("SELECT * from `list` WHERE `title` LIKE '%$search%' LIMIT '$offset','$limit'") or die(mysql_error());[/CODE] … | |
Re: If you are talking about working out the downtime of your server then I would suggest setting up 2 crone jobs. One crone job occurs every minute and the other once a day all year round. The job that occures every minute will append to a mysql database that the … | |
Re: Try replacing it with the following: [CODE]if (mail ( "apcorpinc123@gmail.com", "From: ".$email, "Feedback Form Results", $message)) { [/CODE] If that does not work then post lines 14 to 20 as one of the surrounding lines could be making a difference. | |
Re: [QUOTE=netviper;808263]} $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { if (mysql_error()) $logger->write(mysql_error(), 'ERROR'); } return $result; } function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table … | |
Re: Below is the code for the htaccess file: [CODE]RewriteEngine On RewriteRule ^leftproducts/([^-]+)\.html$ leftproducts.php?s_id=$1 RewriteRule ^leftproducts/([^-]+)-([^-]+)\.html$ leftproducts.php?s_id=$1&start=$2[/CODE] The above code will rewrite the url to the following two urls, first url for the single $_GET variable and second example url below is for when both $_GET variables are in use. [url]www.something.com/leftproducts/1.html[/url] … | |
Re: [QUOTE=dmanw100;808726]What does foreach($array as $value) test for? Or is it actually performing something similar to $value = $array[i]? Thanks for helping me clear this up![/QUOTE] Below is an example that will display all of the arrays and their values in the php format:[CODE=php]<? $var['one']='aaa'; $var['two']='bbb'; $var['three']='ccc'; $var['four']='ddd'; $var['five']='eee'; foreach ($var … | |
Re: [QUOTE=!Unreal;809376]Hmm...Just googled it to double check and it said that split uses regex where as explode uses a string.[/QUOTE] If explode uses a string and split uses regex then what does preg_split use? What is the difference between split and preg_split? Just curious. | |
Re: [QUOTE][CODE]onclick=\"checkform($iMode, $iLevel, 1)\"[/CODE][/QUOTE] That section of code will not work if you do not have javascript enabled. So make sure javascript is also enabled in Firefox and Crome | |
Re: Below is a standard template I have made. login.php[CODE=php]<? session_start(); $dbhost='localhost'; //database host (usually localhost) $accountname='root'; //database username. $password=''; //database password $database='my_database'; //database name - not table //configure the above variables. $linkID = @mysql_connect($dbhost,$accountname,$password) or die("Could not connect to MySQL server"); @mysql_select_db($database) or die("Could not select database"); //adjust mysql query … | |
Re: With this kind of error it is common that a module in your php.ini file is commented. So in your php.ini file, uncomment the line that says: ;extension=php_mysql.dll To uncomment the line simply remove the ; symbol at the beginning of the line. Also the php.ini file can be found … | |
Re: Try making the following your script: [CODE=php]<?php session_start(); if((isset($_POST['username']) && $_POST['username']!="") && (isset($_POST['password']) && $_POST['password']!="")){ $error=''; $conn = mysql_connect('localhost','compkcom_care','ptk')or die('Could not connect to MySQL database. ' . mysql_error()); mysql_select_db(SQL_DB,$conn); $query = "SELECT COUNT(username) AS record FROM admin WHERE username ='" . $_POST['username']."' AND password = '".$_POST['password']."'"; $result = mysql_query($query); if … | |
Re: [QUOTE=jedi_ralf;803832]That's a good solution, thanks! The only problem is if there were commas in the details section, eg: "Likes chocolate, cake and fishfingers". Any ideas? Also, out of interest, is explode more efficient than regular expressions? The examples I gave were only a small section of a larger page. Thanks … | |
Re: Try resetting the variable $query_recpayment to the following: [CODE=php]$query_recpayment = "SELECT `amountpaid`, `username`, `amountpaid` FROM `paymentsummary` WHERE `username` = '%s' AND `foryear` = '%s' AND `forlevel` ='%s'";[/CODE] As you can see the end part had a long php syntax error since a variable cannot assign those extra values in the … | |
Re: Try placing the following at the top of your php file(s) that process the uploads: [CODE=php]ini_set ('upload_max_filesize','10M');[/CODE] That should allow the server to accept 10 Megabyte files and is the most common solution for this problem from previous posts of simular/same problems on these forums. Let me know if you … | |
Re: It's an oop (Object Orientated Programming) error saying that you are treating a function as an object. Mainly it says the function getStrippedName() is not an oop object and has been called as an oop object. So there are 2 solutions. You could convert the function getStrippedName() into an object … | |
![]() | Re: Well for the phpbb cms I will have a look for any hacks to do this but codewise it is the following line which needs to be configured weather you can do it though the config file or if a hack is needed: [CODE=php]mysql_connect('localhost', 'mysql_user', 'mysql_password'); //above needs to be … ![]() |
Re: [QUOTE=malusman;805456]This is a very old thread, but it was the #1 hit with my particular error. I found that the PHP in_array() function will give the "wrong datatype for second argument" warning if the array you are checking is empty or null. In this case, it appears that PHP doesn't … | |
Re: Try something along the lines of the following: [CODE=php]mysql_query("SELECT * FROM `table` LIMIT 0, 10")[/CODE] | |
Re: I have tested it and I think it's a html syntax error. This works for the Opera browser: [CODE=php]<?php $totalbill = mysql_real_escape_string($row_reclog['total']); if($totalbill==0.00) { $disables=""; } else { $disables=" disabled"; } echo "<input type='button' name='button' value='Enroll Now'$disables>"; ?>[/CODE] | |
Re: I just checked the official documentation and although it can be useful to jump out of loops to before the loop had began, I found the effects of using it incorrectly could cause a fatal server error (example: crashing apachie) Below is an example of escaping the loop. [CODE=php]<?php $gotostart=0; … | |
Re: [QUOTE]2)Can we pass input value by using Javascript Sessions...[/QUOTE] Just to let you know, Javascript Sessions are called Cookies. The client side version of Sessions. More can be found about cookies at [URL="http://www.w3schools.com/JS/js_cookies.asp"]http://www.w3schools.com/JS/js_cookies.asp[/URL] | |
Re: Below are 2 options to help solve the problem. Both do the same thing but with different amounts of complexety. My preference is the second code box. And so they are: [CODE=php]$enamysqldb=mysql_connect('localhost','username','password'); mysql_select_db($database_enamysqldb, $enamysqldb); $coursesubject=mysql_real_escape_string($row_reclog['tablename']); $query_reclevelsub = "SELECT * FROM $coursesubject"; $reclevelsub = mysql_query($query_reclevelsub,$enamysqldb) or die(mysql_error());[/CODE] == and == [CODE=php]mysql_connect('localhost','username','password'); … | |
Re: [QUOTE=death_oclock;803634]What does it say in the address bar? If it says "C:\Program Files\Apache Group\Apache2\cgi-bin\filename.php" then you aren't running it through your server. It is not being parsed as PHP. You have to view it through your server: "http://localhost/filename.php" or "http://127.0.0.1/filename.php" (the same thing).[/QUOTE] Just to add to that is it … | |
Re: Just use the following code. Simple and easy to use. [CODE=php]//set the values $value_a=9.43; $value_b=8.20; //now to calculate $value=$value_a+$value_b; $valuesplit=explode('.',$value); if(!isset($valuesplit[1])) { $endvalue=$valuesplit[0]; } else { if ($valuesplit[1]>=60) { $valuesplit[1]='0.'.$valuesplit[1]; $valuesplit[1]=$valuesplit[1]-0.60; $valuesplit[0]+=1; $valuesplit[1]=preg_replace('/[^.]+[.](.*)/','$1',$valuesplit[1]); } $endvalue=$valuesplit[0].'.'.$valuesplit[1]; } //now to echo the value echo $endvalue;[/CODE] | |
Re: [QUOTE][CODE=php]@imagejpeg( $tmp_img );[/CODE][/QUOTE] Line 11 in the above quote is incorrect. You first need to get the image then use a separate function to display the image. To make it simple, I have combined them into one line so try replacing line 11 in the above quote with the following … | |
Re: This is the line that is incorrect (or at least one of them). [CODE=php]$con = mysql_connect("localhost");[/CODE] Replace it with something like the following but replace the username and password with the real username and real password: [CODE=php]$con = mysql_connect("localhost","username","password");[/CODE] | |
Re: The way that I understand it is that variables are defined first, then functions are defined (including custom user defined functions), then from that data any E_Notice errors are generated. After that, I am guessing that it goes through a conversion process (into binary) which is when the fatal errors … | |
Re: I have read the script and if you are using php5 then the following might be better with the functions file_get_contents and file_put_contents. [CODE=php]<?php // removal malicious script by forzadraco $filename="target.php"; $existfile=file_get_contents($filename); if($existfile){ echo "file berhasil dibaca \n\n"; }else{ echo "file gagal dibaca \n\n"; } if( false == ($str=file_get_contents( $filename … | |
Re: I have just resolved a much simular error myself a few minutes ago and turned out the container was not assigned to the variable properly. An example is the following script: [CODE=php]$container_variable = new object(); $container_variable->function();[/CODE] So that above example is when everything is working. But say the following happened: … | |
Re: Also in the past, I have seen this question a few times and a popular answer seems to be Ajax. Although I don't know the first thing about using Ajax, I believe it is ment to be able to read your mysql databases from the client side. From memory lane … |
The End.