1,376 Posted Topics
Re: Also if you plan to have a lot of traffic you can use url's and arrays. Simply assign each error message a number and place each number in the url $_GET tag then use something like the following to retrieve the errors. [CODE=php]<? //$_GET['errs']=1-3-5-6 $errors=explode('-',$_GET['errs']); $error[0]='This is the first error … | |
Re: Try and simplify the mysql query with the following on line 4: [CODE=php]$query_recunvesummary="SELECT * FROM paymentsummary WHERE username='".mysql_real_escape_string($_SESSION['MM_Username'])."' AND paymentmode='".mysql_real_escape_string($modeofpay)."' AND foryear='".mysql_real_escape_string($_SESSION['MM_yearlynow'])."' AND initialstatus='".mysql_real_escape_string($_SESSION['MM_paymentstatus'])."'");[/CODE] And also make sure the variables/arrays have valid values. | |
Re: In my opinion, as long as you don't have more than 500,000 photos to list, you should be able to store them all in the one table without the slightest cpu problem providing the script is written correctly. But if you plan to have more than five hundred thousand (500,000) … | |
Re: Well php comments from my judgment would effect the page by a few microseconds and there are 10000 microseconds in a second. And as for html/css/javascript comments, they only effect the download time by a few bites. To calculate how much they effect the download time it is the number … | |
Re: Well the mail script behind the scenes isn't as simple as it sounds. From what I have read in the manual some time ago, testing the mail function in an if statement only tests what may have gone wrong on the php side of things. If it passes that if … | |
Re: If you want a random password for general purposes then simply just do a hash of the current date, time and microtime. The following is an example: [CODE=php]echo substr(hash('sha1',date('d F Y G i s u')),0,10);[/CODE] But if you are trying to hack into a school network like you have mentioned … | |
Re: Although I couldn't understand all of that question(s) to empty all sessions just use the following: [CODE=php]$_SESSION=array();[/CODE] | |
Re: Try removing the quotes from the mysql_num_rows line like the following: [CODE]if(mysql_num_rows($userrow) == 1){[/CODE] | |
Re: Although it is possible, you will find that the typing speed php calculates will be slower than the real typing speed due to page loading and submitting time. For this reason you should deduct about 1 second from the overall time if the page has no graphics. As for how … | |
Re: Try and replace your echo statement with the following: [CODE=php]echo '<input name="Upload" type="button" id="Upload" onClick="document.location.href='/Project/Upload.html';" value="Upload New File">';[/CODE] You forgot to add the quotes and return symbol as corrected in the above script. | |
Re: And it is as follows: /phpmyadmin/config.inc.php Just adjust the appropriate variables/arrays. | |
Re: Also your $_REQUEST['councillor'] is incorrect. It should be $_REQUEST['emailler'] or $_POST['emailler'] I have made a few modifications to the php file to fix it up a bit and compact the code. Sorry if I confused you but the way I would do the code is something like the following: [CODE=php]<?php … | |
Re: In case you didn't know that is a mysql syntax error used inside the mysql_query() function. So could you post what you placed inside the mysql_query() function(s) that this error relates to. It is really just the string/text inside that function that we need. Thats where the real error is. | |
Re: I understand that this is solved but to make it clear of what was happening, I translated the script in post #1 to something easier to read and slower to execute and it reviels in the status bar different servers the javascript made the browser communicate with. Although most of … | |
Re: BTW, just to give you an idea of where Murtan is talking about (not very obvious) it is the following line of the second file where value= [CODE=html]<input type = "radio" name = "gender" value = ""/>Both[/CODE] As you can see there is no value assigned to that field and … | |
Re: Is that real?! Nice movie especially the end bit when the person runs through the wall with a nice trip. By saying trip I mean falling over. lol | |
Re: You may also want to note that if you plan to send 2000 email during exactly an hour then you will want to setup a timer to time how long it took for the script to execute before the sleep function then subtract that time from 3600. | |
Re: I would sugest making a form with two fields (a drop-down menu and password field) for the download precess. The drop-down menu or known as a combo box is where a user can choose from a the file to download in the password field is the password required for that … | |
Re: The official silverlight website is at [URL="http://silverlight.net/learn/learnvideo.aspx?video=50557"]http://silverlight.net/[/URL] and in case your wondering, silverlight was originally developed in aspx or asp.net. (Microsofts server-side language.) But as for redeveloping it in php, I would suggest using a lot of css templates and maybe even copy some of the silverlight css code if … | |
I have spent endless hours searching the web for a few days now and still the only tutorial I have found (doesn't even show everything I need) is at [URL="http://www.functionx.com/vcnet/controls/combobox.htm"]http://www.functionx.com/vcnet/controls/combobox.htm[/URL] But what I need is code or tutorials on how to make graphical interfaces such as textboxes, scrollbars, tickboxes etc … | |
Re: I see you used dbquery() instead of mysql_query(). Any reason for that. Also I have fixed the line mentioned in the error and your code should now look something like the following: [CODE=php]<?php include("admin/config.php"); $ipgf=99; include("admin/$languagefile"); include("functions.php"); if (isset($_GET['open'])) include("functions_pcode.php"); include("auth.php"); //Title session_start(); $_SESSION['titlu_pagina'] = "Cabinete medicale, servicii medicale, farmacii"; … | |
Re: [QUOTE=clmirand]hi there.. i almost got the same problem. i have 3 drop down menus in my page. i was able to populate the first drop down menu. the 2nd and 3rd drop down menu was not successfully populated.[/QUOTE] Well you have only provided one query there so that would be … | |
Re: From my usage of text files, although I often read text file (both txt and htm) I seem to never write to text files. I suppose MySQL has always been a better alternative especially since it is not garranteed that the data you write will be actually written to the … | |
Re: Or if you don't like the ugly url when using hyperlinks then use sessions. To convert $_POST to $_SESSION simply use the following at the very top of your action.php page: [CODE=php]<? session_start(); foreach($_POST AS $key => $val) { $_SESSION[$key]=$val; } unset($key); unset($val);[/CODE] Then on every page that uses sessions, … | |
Re: If you are talking about the line number the die() function is used on then the following is an alternative die function that will show the line number. [CODE=php]function dieline($stringz) { $dataz=file_get_contents(basename($_SERVER['PHP_SELF'])); $datazz=explode($stringz,$dataz); $rowz=substr_count($datazz[0], ' '); //must start at beginning of line die ('<b>Error Line number '.$rowz.'</b><br>'.$stringz); } //now to … | |
![]() | Re: Maybe Java. Many browsers block most popup windows but I think Java and Flash are exceptions. Note that Java is not Javascript. ![]() |
Re: Try the following: [CODE=php]if(isset($_SESSION['u_name'])){ include 'dbcon.php'; $qry = "SELECT * FROM `tbl_user` where `user_id`='".mysql_real_escape_string($_SESSION['u_name'])."'"; $result = mysql_query($qry,$con) or die(mysql_error()); if(mysql_num_rows($result)>0) { while($row=mysql_fetch_array($result)) { echo ' Welcome ' .$row['user_name']; } } }[/CODE]Note: Please use code tags. | |
Re: Check the file size that is downloaded. If it is 0Kb then you will find that your script is not specifying the correct location. Other than that I don't have a clue as the syntax used in your code is a bit hard to read. | |
Re: To have a session on multiple domains you would need to have the session id in the url instead of the sessions cookie as cookies only work for one domain. So when linking to a page, link to a page like this: [CODE=php]<? echo '<a href="page.php?'.SID.'">Link Title</a>'; ?>[/CODE] The SID … | |
![]() | Re: [QUOTE=pritaeas]See the exec/shell_exec/system commands.[/QUOTE] Also note that I find these functions are a [U]use at your own risk[/U] type functions because they can cause some servers to crash when security is tight on the server. And that includes the passthru function. But running exe's with php, don't you think in … ![]() |
Hi and I have installed some software called virtualbox which is a universal operating system emulator. I have XP Pro and emulated XP Home inside XP Pro but my problem is that my keyboard can only input one key stroke a second. Is it possible that it is because my … | |
Re: You can also preg_match a specific set of characters/letters/numbers so that if certain characters are found in the string that should never exist then it would fail the function test. An example is the following that checks if characters other than A-Z a-z 0-9 +-/\* are found. So the example … | |
Re: There is a topic about it at [URL="http://www.daniweb.com/forums/showthread.php?t=91019&highlight=excel"]http://www.daniweb.com/forums/showthread.php?t=91019&highlight=excel[/URL] It basically says to use the excel html formating like when you export html file from excel. Also it quotes the following code: [QUOTE][CODE=php] <?php echo "<table cellspacing='4' cellpadding='4' border=1 align=center>"; echo"<tr>"; echo"<td>Day</td>"; echo"<td>Time</td>"; echo"<td>Unit</td>"; echo"<td>Lecturer</td>"; echo"</tr>"; echo"</table>"; header("Content-type: application/octet-stream"); # replace … | |
Re: Also you may want to note that the link identifier is not always optional. An example is if you wanted to connect to multiple accounts then that is when you will need to specify which account to find the database structure in. And to specify which database structure or account … | |
Re: Also don't forget the tizag tutorials at PHP: [URL="http://www.tizag.com/phpT/"]http://www.tizag.com/phpT/[/URL] MySQL: [URL="http://www.tizag.com/mysqlTutorial/"]http://www.tizag.com/mysqlTutorial/[/URL] And of course the official documentation for after you know the basic usage of php: [URL="http://www.php.net"]http://www.php.net[/URL] | |
Re: In addition you have an extra closing bracket on the first line and your mysql query's need escaping. Try making your code the following: [CODE=php]<?php $dbcnx = mysql_connect("localhost","user_name","password"); if (!$dbcnx){ exit('<p>Unable to connect to the database</p>'); } if (isset($_POST['submit'])) { $SchoolName = mysql_real_escape_string($_POST['SchoolName']); $SchoolEmail = mysql_real_escape_string($_POST['SchoolEmail']); $UserName = mysql_real_escape_string($_POST['UserName']); $pscode … | |
Re: Simple... Just allow the email to have html formatting then place an invisible iframe that links to your website and you can then use that iframe to use $_GET to say that the email has been recieved. An example is the following: [CODE=html]<iframe width=1 height=1 src='http://www.yousite.com/email.php?id=195'></iframe>[/CODE] So when your email.php … | |
Re: Sha1 encryption. Personaly I like to take a more secure approach. Below are two hash functions which are way more secure: [CODE=php]function truehash($hashzzz) { return hash('crc32b',hash('whirlpool',$hashzzz)); } /* below hash function is more secure but takes more cpu. */ function securehash($hashzzz) { return hash('crc32b',substr(hash('whirlpool','asdf'.$hashzzz.'a'),64)); }[/CODE] So try one of those … | |
Re: It is because you have output something to the browser before session_start(). Below is an example of what to do:[CODE=php]<? session_start(); ?> <html> More browser output. <? //now php code ?>[/CODE] Below is an example of what not to do:[CODE=php]<html> <? session_start(); //php code ?>[/CODE] As you can see, in … | |
Re: Also change [ICODE]$to = "mymail@anydomain.com";[/ICODE] to your real email. In addition, another possible error which I am unsure if exists is that the if element may need to be as follows: [CODE=php]if (mail($to,$subject,$message,$headers)) { mail($to,$subject,$message,$headers) echo "Mail Sent."; }[/CODE]But I am unsure about if element and have never known if … | |
Re: [QUOTE=MaxMumford;815026][icode]mysql_query("DELETE FROM user_notifications WHERE username='".$acc."' AND notification='".$note2."' ");[/icode] that should be fine. if its not, try checking your $acc and $note2 variables...[/QUOTE] You also need to escape the variables like this: [CODE=php]mysql_query("DELETE FROM `user_notifications` WHERE `username`='".mysql_real_escape_string($acc)."' AND `notification`='".mysql_real_escape_string($note2)."' ") or die(mysql_error());[/CODE] | |
Re: You could also just store the image names in an array and refer to the array with the number. An example is the following. [CODE=php]<?php function image() { $min = 1; //The first number one of your images has $max = 3; //The highest number you image has $num = … | |
Re: Try the following: [CODE=php]$string='seaweed#'; $strb=explode('#',$string); $strb[0]=str_replace(array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),array('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26'),$strb[0]); $newstring=$strb[0].'#'.$strb[1]; echo $newstring;[/CODE] | |
Re: If you want it so that when the above menu is submitted then another menu will appear then try the following: [CODE=php]<form action="index.php" method=GET name=chcat > <select name=id onChange="document.forms['chcat'].submit();"> <option value=0>All</option> <option value=2>Pizza</option> <option value=4>Special Dinners</option> <option value=5>Side Orders</option> <option value=6>Salads</option> <option value=7>Spaghetti or Ziti</option> <option value=8>Home made Lasagna Ravioli … | |
Re: Also it would probably be better to use strlen() or empty() to determine if there is no value to the array. Script should look like following: [CODE=php]$sql = "SELECT * FROM `list` WHERE `title` LIKE '%".$search[0]."%' AND `url` LIKE '%".$sites[0]."%'"; $catcnt = mysql_fetch_row(mysql_query($sql)); if(empty($catcnt[0])) { header('Location: index.php'); } else{ echo … | |
Re: It appears in your script that there isn't a valid email. That is one thing that can cause an email delivery to fail. Also as for the php.ini file, it isn't that easy to configure. The php.ini file is driving me crazy to get my localhost php email function working. … | |
Re: The following is a sample of a very basic email form which you can try editing: [CODE=php]<? if (isset($_POST['subject']) && $_POST['message']!=='') { $address = "your_real_email@domain.com"; //change this to the receiving address. $subject = "Website Email: ".$_POST['subject']; if ($_POST['name']!=='') { $body = "<table border=0 cellpadding=5 cellspacing=0 width=200><tr><td>".$_POST['message']."<br> <br> Yours Sincerely<br> ".$_POST['name']."</td></tr></table>"; … | |
Re: I think rohnni just spammed because there is a thread about what rohnni just posted at [URL="http://www.daniweb.com/forums/thread178810.html"]http://www.daniweb.com/forums/thread178810.html[/URL] Edit: @ rohnni Shouldn't you keep your php problem within your topic. | |
Re: Perhaps it takes time for the cookie to be set in IE or that an additional page load (any page on the site) may be needed. | |
Re: Make sure there are no spaces or new lines before the php opening tag <? Sometimes there may be something before that opening tag that outputs to the browser which is causing that error. |
The End.