1,376 Posted Topics
Re: [QUOTE=HITMANOF44th;1191627]i would would suggest i dont know if this is the right way but i would make a table that has a index / username / post_id so every time the user would click on the new post it would write to the table that he saw it you can … | |
Re: Hi and welcome to daniweb. I see you have a mini tutorial and yes it may be php 101 but I hope you enjoy your time here. Good luck. | |
Re: Not too clear as it looks like the text is copied directly from a homework book but if I'm correct what your looking for is ajax. This is where javascript can communicate with php without refreshing the page. There is a nice tutorial at [URL="http://www.tizag.com/ajaxTutorial/"]http://www.tizag.com/ajaxTutorial/[/URL] Enjoy. | |
Re: The all famous classic mail bug. Try the following: [CODE]function sendVerificationEmail($email, $code){ $to = $email; $subject = "Please activate your account at ".SITE_NAME; $from = "registration@domain.com"; $headers = "From: $from\n". "Reply-To: support@domain.com\n". "X-Mailer: PHP/".phpversion(); $message = "Welcome to domain.com\n" . "We see that you recently opened an account with us.\n" … | |
Hi, I have a vps and soon a dedicated with 3.2GHz quad but now the devil has come back to haunt me (DNS). On my current vps I can get the domain cwarn23.info to work but all of my addon and parked domains don't work (eg. chatbac.net). They simply can't … | |
Re: Alternatively you may want to change the column type to a blob or char. But for a char type you will need to specify the maximum length of storage input. Also the type of character set you set a table to be can also make a difference. | |
Re: Could you please explain in more detail what your problem is and if necessary provide some code because it is hard to understand with very few details. | |
Re: Try this [CODE]if (preg_match('/[^0-9,]/', $ids_list)) { echo 'No good!'; } else { echo 'OK!'; //only 0 to 9 and commas. }[/CODE] | |
Re: Could you elaborate on the question. Sounds like line 29 should be as follows [CODE]<form action="upload.php" method="GET">[/CODE] But I could be wrong as you haven't explained your question with enough detail. Also when sending pm's to me please just send a pm with a link to your topic page and … | |
Re: [QUOTE]Why they have to find patterns in a http page?[/QUOTE] Well one reason is because all browsers need to be able to preg_match_all the html tags. The second reason is because javascript provides some regex functions which the browser needs to be able to process. | |
Re: Maybe the following. [CODE]$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT RAND(),1"); $row_table = mysql_fetch_assoc($results);[/CODE] If that fails to return a row then rand() is returning a number higher than the number of rows present. ![]() | |
Re: Do you mean like the following? [CODE]$fullurl = "http://www.mysite.com".$_SERVER['SCRIPT_NAME'].'?black='.$_GET['black'];[/CODE] | |
Re: I would suggest using curl to tap into another websites currency converter. Let me know if you would like an example as it would be kinda hard to make. | |
Re: Although I rarely use xml there is a [URL="http://au2.php.net/manual/en/book.xmlreader.php"]xml reader library[/URL] and perhaps that will be the key to solving your problem. I haven't used the xml libraries before since I haven't used xml much but hopefully that link should be of some use to you. | |
Re: Try the following: [CODE]$user = stripslashes($_POST["user"]); $dirname = "./cp/userfiles/$user/"; if (is_dir($dirname)) { echo "The directory $user exists"; } else { mkdir("userfiles/$user", 0777); echo "The directory $user was successfully created."; }[/CODE] | |
Re: Try this. [CODE]$sql2="select allocatedmemory from projects where projectname='$projectassign'"; $data1=mysql_query($sql2) or die(mysql_error()); echo '$data1';[/CODE] [edit] Oops, and the echo will need changing to suit your purposes. What are you trying to do on the echo line, trying to display allocatedmemory? If so then try the following [CODE]$sql2="select allocatedmemory from projects where … | |
Re: Perhaps [URL="http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html"]this tutorial[/URL] would help. | |
Re: Do you mean to select from the database and count how many are selected. If that is the case then use the following: [CODE]<?php $result=mysql_query('SELECT * FROM `table` WHERE `Location`="City1"') or die(mysql_error()); echo mysql_num_rows($result);[/CODE] Hope that helps. | |
Re: [CODE]$time_start = microtime(true); $r=mysql_query($sql); sleep(1); //let the server relax after such a big query. $time_end = microtime(true); $time_for_mysqlquery = $time_end - $time_start; $number_of_rows=mysql_num_rows($r); //works only for SELECT in mysql query[/CODE] | |
For a while I have been thinking this but never got around to saying it. As we all know hijacked threads is a big problem and the solution that came to my mind was perhaps to setup a function where all threads that are older than two years are automatically … | |
Re: Although I haven't tried using imap with gmail I have heard of gmail api's that can be used (unofficial ones) where you can easily connect to gmail and send mail via gmail. So try googling for php gmail api or something like that. | |
Re: This should be made a sticky. It means there is html or binary output before the function session_start(). Some IDE's put a binary code at the beginning of the file causing this error but one of the more common reasons is that you have some white spacing just before the … | |
Re: To unset a session simply use the following. [CODE]<?php session_start(); //first line of file //blah... $_SESSION=array(); //unset session[/CODE] | |
Re: Yes there are several things wrong with that code. One is that the Update sql query seems to be updating with empty variables unless there was something I did not read inside the include(). Also your mysql query's are venerable to sql injections. In other words people can easily hack … | |
Re: Edit: Didn't read the previous post and said the same thing | |
Re: So what exactly is the problem. I see on line 2 you need to add the second quote into the function input but other than that the code looks fine. Could you please explain what the question is as I see a pretty script with a description but no mention … | |
Re: The easiest way to do it is just install Windows 7 on the machine then install a program called Virtualbox. With this program you can create virtual machines just like a vps but with the gui. So then you could allocate a certain amount of ram for Windows Server 2008 … | |
Re: I'm no Joomla expert but I would suggest googling around for a pre made solution such as a patch. | |
Re: It can be done on some sites simply by sending the same http request as the normal login process would send but many sites have security protocols in place which make it a little harder. I believe there is a firefox plugin that can record the http request info when … | |
Re: I see your new to daniweb and all but could you please explain in a little more detail. I mean like a paragraph of english with only small code snippets that demonstrate the problem instead of the entire source. I'll be waiting for the second post in the morning but … | |
Hi, I have got a laptop, a desktop and soon will have a server but want to share the cpu between all of these machines so that if one computer crashes they all crash. In additon if a computer exceeds it current ram/cpu usage then it would grab cpu/ram from … | |
Re: Try replacing lines 33 to 50 with the following [CODE]<?php if (isset($_POST["$submit"])) { $id2 = mysql_real_escape_string(stripslashes($_POST["id2"])); $name = mysql_real_escape_string(stripslashes($_POST["name"])); $email = mysql_real_escape_string(stripslashes($_POST["email"])); $age = mysql_real_escape_string(stripslashes($_POST["age"])); $birthday = mysql_real_escape_string(stripslashes($_POST["birthday"])); $address = mysql_real_escape_string(stripslashes($_POST["address"])); $number = mysql_real_escape_string(stripslashes($_POST["number"])); $sql = "UPDATE contacts SET name='$name', email='$email', age='$age', birthday='$birthday', address='$address', number='$number' WHERE id2=$id2"; $result = mysql_query($sql) … | |
Re: The normal way of redirection which even cpanel uses is making a .htaccess file. I would suggest following a few tutorials on making redirects with a .htaccess file. | |
Re: The http referrer information is not very accurate and is best to ignore whenever possible. Why are you trying to get the referrer information because perhaps there is a better way of doing the job such as sessions. | |
Re: Yes, php can read open delete change and close email boxes just like gmail or hotmail can. The library that does this is the [URL="http://au2.php.net/manual/en/book.imap.php"]imap library[/URL]. Also if you are planning on creating 50+ email's via php then I would suggest getting a managed vps as you might get into … | |
Re: Could you give us an example of your problem. A demonstration of how to use new lines in php is as follows. [CODE]$text='This is the first line\n'; $text.="This is appended to the first line\n"; $text.='This is the second line separated by a \n'; $text.="\nThis is the last line.";[/CODE] As you … | |
Re: As well explained your post was I didn't exactly get the problem. From my understanding you want to use regex to extract links from html input. If that is correct then the following would be your solution. [CODE]<?php $html_input='<img class="a" title="htc-pure-1" src="http://www.site.com/wp-content/uploads/2010/03/htc-pure-1.jpg" alt="">'; preg_match_all('@\<img[^\>]+src\="([^"]+)"[^\>]+\>@Uis',$html_input,$output); $output=$output[1]; print_r($output);[/CODE] | |
Re: Try the following [CODE]RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?(.*)$ /index.php?page=$1 [L][/CODE] | |
Re: [QUOTE]My question is; I am trying to create an associative array in which each element of $matches[1] is keyed to it's corresponding $matches[2]. What is the best way to do this?[/QUOTE] Could you elaborate on that or explain in more detail because some of those terms don't make any sense. | |
Re: If you want somebody to embed bbcode for you then I don't think many people will offer unless you put some effort into it. I have read that there is a [URL="http://au2.php.net/manual/en/book.bbcode.php"]bbcode library[/URL] or alternatively if that library isn't available on your webhost then you can use the recourse hungry … | |
Hi, I have made an encryption and decryption script for those who want to encode data and decode the encoded data. This script may especially be useful for those who do not have the mbstring library installed as it uses a math grid. So for example you can store the … | |
Re: Your regex should be as follows: [CODE] $replace = "#\[vimeo[^\]]+([0-9]+)\]#is"; [/CODE] | |
Re: Well why don't you upload them to your own site? That would be the ideal solution but if you wish to use youtube then post your code and the link to the tutorial you used and I shall attempt to debug it. | |
Re: With 30 to 40 TB of traffic you would probably be best to A - host with your own server at home with an isp that accepts unlimited traffic or B - you can risk yourself in one of those online scams with unlimited traffic. Personally I would go for … | |
Re: Did you make sure that there is no white spacing before the [ICODE]<?php[/ICODE]. Also what IDE are you using. Try opening your file in the old fashion windows notepad and delete any invisible white spacing before the < symbol at the beginning of the file. Some IDE's place a binary … | |
Re: I received your pm and your code should be as follows. [CODE]<?php ob_start(); @session_start(); require_once ("check.php"); createsessions($username,$password,$userid,$projectid); $con=mysql_connect("10.70.1.50","invensis","invensis"); if(!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database_myproject",$con); $sql="SELECT projectname from projects where createdby='$_SESSION[username]'"; mysql_error(); $result=mysql_query($sql); $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["projectid"]; $projectname=$row["projectname"]; $options.="<option value=\"$id\">".$projectname.'</option>'; } $sql2="SELECT * FROM users where … | |
Re: [QUOTE]Is there anyway to delete your own post?[/QUOTE] The answer to this is no for a good reason. I'm sure that people like Dani don't want the whole of daniweb being deleted because of deleted posts so IMO it is best to [U]not[/U] be able to delete posts. Also why … | |
Re: [QUOTE=cscgal;1171746]The long page loads (including all the http requests) are a result of the ads, I'm afraid.[/QUOTE] I have tried using adblock for Opera but although removing the ads makes some difference it still takes ages for the gray forum menus to respond. My speed is 64kbps and the only … | |
Re: [QUOTE=ardav;1172565]I'm not saying it can't be broken, but it's pretty good - sufficient for me anyway. SHA variants are also worth looking at. Note - this is hashing, not encrypting. Encryption involves an algorithm creating some ciphertext which can be decrypted with an appropriate key. md5 cannot be decrypted or … ![]() |
The End.