Do you mean like the following?
$data=explode(',',file_get_contents('path/to/file.txt'));
for ($i=0;$i<count($data);$i++) {
echo $data[$i];
echo '<br>';
}
Do you mean like the following?
$data=explode(',',file_get_contents('path/to/file.txt'));
for ($i=0;$i<count($data);$i++) {
echo $data[$i];
echo '<br>';
}
This is a file forbidden error. So post your .htaccess file or if you don't have a .htaccess file then post your apache httpd.conf file. It is usually a configuration with the virtual hosts that causes this error.
If spam is the problem then what is wikipedia's solution? Wikipedia turned out great as a force of volunteers clean up the mess (the users). So surly the same concepts could be applied to daniweb. Then all you would need to do theoretically is have 1 person delete homework answers. I don't know the secret to raising a large online community but I thought it would be a great idea to have a wiki where books/tutorials/code/guides/faq's could all be made.
I thought I would suggest and ask "Why doesn't Daniweb have a IT wiki?" I'm sure there would be plenty of members to contribute. Is there any reason dani or is it a thing that's coming soon?
Try each of the following
$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 0,1");
$row_table = mysql_fetch_row($results);
$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 2");
$row_table = mysql_fetch_row($results);
$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 1,1");
$row_table = mysql_fetch_row($results);
My theory is that the limit 1 statment wasn't designed to be ordered by random. But maybe we can make a work around this bug.
I just check almostbobs first link and it was like wtf google deleted you from google maps. The street view for that link doesn't even work any more just like in post #1. But your second link is cool. It has for sure been photo-shopped unless I'm seeing double. The ghost of the blue car appears in front of itself like if it has been edited. There you go, cars have ghosts too after they break down. lol But thanks for sharing.
Well using my method the default OS would be the last one installed but if you used a program like Partition Magic then you might be able to change the default order via Partitioner settings.
So we are talking about the type of clothes - yes clothes not cloths then I guess mine would be anything that fits and doesn't have pictures. My favorite is a black shirt with thing dotted white lines on it along with grey shorts. (Not short shorts but just shorts.)
I followed this google car around for half a day
they fuzzed my face out of every pic
I am very upset
My car is in google maps a hell of a lot
Could you give a link to you in google maps. I wonder if I'm still in google maps but they blurred my face too. I remember the time google maps captured a person nood and getting changed in the street then they blurred the person in the nood. That pic was as funny as on googles website.
As for the google van here in Australia it is very different. Usually it is white with a 1 foot tall camera with the camera itself looking like a football shape/sized unit.
To make things easier the following.
$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT ROUND(RAND(COUNT(*))),1");
$row_table = mysql_fetch_assoc($results);
I would wear custom t-shirts too, if only I knew where to find some. :(
Why not make them at home. They're easy to make.
Steps
1 - Then you could install First install Windows 7.
2 - Then temporarily install ubuntu to partitioned the disk. The ubuntu partition will be the size of the Windows Server partition.
3 - Install on top of Ubuntu Windows Server 2008
4 - Install Ubuntu and it should automatically choose the Windows 7 partition to split. Select the size of the Linux partition
5 - Install your Linux flavor on top of Ubuntu.
I don't know if that will 100% work but theoretically it should.
I thought his associate was attempting to moon the Google vehicle as it went by but missed the chance. Does anyone know what these cars look like? I've never seen one.
I've seen them 3 times. They are a white or black small car with a small tripod on top which has like a 360 degree camera.
Welcome to daniweb and let me be the first to say do your own homework as it is called homework and not daniwebwork. The solution is fairly straight forward if your familiar with the language your using. I would suggest take a crack at it and if all fails then post a topic with your current progress asking for hints/clues and not the answer. A good programmer can easily work off hints and clues like I do every day. But if this is php or c++ then I may be able to help you a little but until you show reasonable effort there is not much we can do.
I thought the Java language was called Java because the people who programed Java ate/drunk a lot of Java to stay awake while programming. I will have to try that some day.
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 and Linux so they can all run at the same time.
I would suggest looking at the gd library. Then later on you might want to switch to the imagick library.
Mine is either MS. pacman,SUPER MARIO BROTHERS or Dig dug :)
lol Good one. Microsoft Pacman. lol
I think you mean this
I guess we learn something new every day. So it is clothes that I wear so what do you wear?
Hi, I have made a chatroom but now want to make a bot for that chatroom. Does anybody know where I can find documentation as to the theory behind making the AI for a chatroom bot. Or even better, a simple open source PHP chat bot. The main goal is that the bot can read data from a text file or database then display appropriate sentences from that file/database to the user.
Thanks - cwarn23
Use the following:
echo '<div class="mydiv">';
echo file_get_contents($sReportPath);
echo '</div>';
Then use css to add the scrollbars.
What is the problem in the 2nd link?
The data hasn't been uploaded to google maps yet.
You mean thongs??
No I mean cloths or cloves whichever is the right spelling. lol
I think he wants a link and I shall provide one.
http://syntax.cwarn23.net/PHP/Making_a_search_engine
How nice, what do you want us to do? Make it for you?
I very much doubt that will happen.
Show us the script you have now and we can suggest improvements or changes.Other than people who want an ego boost, you won't be spoon fed anything.
Maybe the following.
$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT RAND(),1");
$row_table = mysql_fetch_assoc($results);
If that fails to return a row then rand() is returning a number higher than the number of rows present.
I know absolutely nothing about javascript, but I can learn if I need to. But will it allow me to send the variables to another PHP program? The answers they have given need to go over to the scoring page/program.
Javascript is client side where as PHP is server-side and to pass data between the two there are two methods. On page load PHP can echo data to Javascript but for javascript to send data to PHP a component of Javascript called Ajax is required. Ajax allows communication between the webpage and php at any time even after the page is fully loaded. So I'm sure the answer to that is Yes.
Hi and welcome to daniweb. To start off with I noticed that you are asking us to answer your homework for you. Well unless you show reasonable effort then you won't get anyone elses replies. I would suggest having a go at it and if there are any troubles then post those problems here. And if there are error messages then post the error messages here too. But this is a big assignment and I don't think any single person will answer the entire thing for you. Good luck :)
I would suggest using a piece of javascript like the following.
<script>
setTimeout('window.href="http://www.example.com/anotherpage.php";',5000);
</script>
The above redirects the user in 5 seconds and is echo'ed in the <head></head> section as javascript.
I don't know about you but I like to wear cloths.
Um, iPad applications can do multi-threading. You don't know the difference between threads and processes, do you.
Aren't the processes the sub objects of the operating system and multi-threading when 2 or more processes can be processed at the same time? That is what I thought.
I think the best 3d game made is Duke Nukem 3D Atomic Edition followed by Doom 1. I know many of you's will say that's a 2.5D game but how can be as it can't have half an axis. Anyways back on topic, my friend recently introduced me to a real game called Unreal Tournament 1. I am now buying Unreal Tournament 3 to see the difference. So that makes my latest favorite Unreal Tournament and I'm a natural.
Why not use the following?
$number='10000000000';
echo $number.'<br>';
//now some math
echo bcadd($number,'500');
echo '<br>';
echo bcpow('2','2048');
As you can see all numbers can be dealt with as strings using the bcmath library. So this means the size of the number is only limited to the computers ram and cpu instead of 2^63 or 2^31.
Well in a few weeks all of those links will probably work. It would just be in the middle of the process of updating the index but this is no new problem. Just a more obvious one as more updates are been made.
Computer multitasking is the apparent simultaneous performance of two or more tasks by a computer's central processing unit.
<<snip>>
I agree with you there although this post will probably attract negative votes. Multitasking is basically when an operating system eg. windoze has multiple tasks running and the tasks windoze has running are objects which are programs. So for example with windoze you can run 20 programs/objects/tasks all at the same time sharing the same cpu. This term is more commonly known as multi-threading. An example of a computer which does not use multi-threading or multitasking is the Apple ipad (Equivalent to the Microsoft Tablet). So in the Apple ipad which does not use multi-threading, you can listen to music but do nothing but listen to music or write a book but do nothing but write the book. This is single tasking where every program or object requires all of the systems recourses even if it only really needs 0.001% of the recourses/cpu.
I did it a while ago, but it used the file system to store messages.
To do what you are wanting you would need to use a php socket server and flash. I don't think its possible without those.
You might be able to create the socket server and then have ajax call a php script that queries the socket server for new messages.
Happy post 1234 as shown in your post count and seems like it would be a hard one to create as flash is the devil. Also I haven't really used sockets and have a basic knowledge of flash and Java. I guess this one is a bit too advanced for me. So mysql it is. Thanks for the heads up anyways. :)
To clear the session simply use the following.
$_SESSION=array();
It seems the policies on publishing tutorials on daniweb are very strict but is there any reason why they need to be unique (eg. SEO) It would be nice if daniweb had a wiki that everybody could contribute to.
I have a bunch of php tutorials at http://syntax.cwarn23.net/PHP which I wouldn't mind if were copied to daniwebs php tutorials. Just make sure that the post is by cwarn23 or that it's noted cwarn23 made the tutorials.
I agree with you jephthah. My 2 years guess was only a rough estimate but yes it would make more sense for it to be 3 or 4 months.
Hi, I would like to post a few php tutorials but can't find the section where I can post tutorials. Does anybody have a link as to where to post tutorials in the php forum? Thanks.
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 marked as closed and can only be reopened by the topic owner. Do you think this would be possible to do as it would make it impossible to hijack old threads.
Hi and I remember reading in a really old topic that somebody here was able to write a chatroom without using mysql or any other database system. Can somebody explain how this is possible with just javascript and ajax? What I want to do is to have a script that won't record the conversation on the server but instead send the data directly between the client machines. I'm clueless on how to do this so can sombody please explain as I have already done the login and css.
For a fee, I hope?
Yes for free. It is one of the things I enjoy doing when I have plenty of time. And latley I have had a lot of time with my SHA1 project aborted.
Well no homework questions are allowed on daniwe BUT I will happily talk you through it *cough* answer *cough* via msn at msn@cwarn23.info
There are several ways of doing it. The most common being using gd although the gd library is a tiny library that handles very few file formats. I would recommend using the imagick library and this can be viewed on the php documentation.
If you want to insert into different columns different values then try the following.
$array=array('column1'=>'value1', 'column2'='value2', 'column'='another');
$sql='INSERT INTO `table` SET';
foreach ($array AS $key => $val) {
$sql.=' `'.mysql_real_escape_string($key).'` = "'.mysql_real_escape_string($val).'",';
}
$sql=substr($sql,0,-1);
echo $sql;
Boy! I thought you have given up!
I have for the next 7 or so years until hardware technology advances.
Your first two posts on daniweb are bumping a 2 year old topic which by the way is clearly marked solved. Did you not read my signature or what are you doing just joining to only bump a really old topic twice. If you have any questions then start a new topic with a link to this topic and I will happily answer your questions. But as mentioned before the following code works.
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "", $fullhost);
echo $host;
?>
And in case your interested the explode function would be better to use in this situation instead of preg replace but still you don't need a database to get the hostname as the information is already posted to php where php can report it to you.
I don't mean to be nasty or anything but sometimes you should know your limits. Eg. how older topic to post on and weather to post on a topic that's already solved.
No guys you need to purchase isp information database.
I have a theory on how to crack sha1 but it will take 5 years of new computer technology before I can apply this theory. This theory is based on the IBM guess and go devision theory. It would require 64GB of ram and 2TB of diskspace. With the IBM guess and go theory of division it can also be applied to other operators such as reversing 2+2=4 reverses to 4=2+2 && 4=3+1 && 4=4+0. Then can be filtered by checking if it is comparable with the next irritation. So that would crack the first 80 irritations of the sha1 algorithm getting the word[] array which would then be processed by the next loop. But I will need to wait for computers with 64GB of ram to become publicly available.
You seem to forget the fact that a smart developer adds security measures to prevent crack attempts from shallow developers like you.
SHA1 is a 160-bit one-way encryption algorithm, so the end result is always 160 bits. If you make the input longer than 160 bits, you've made the hash dramatically more secure. I generally try to make mine 3~4 times the length of the resulting digest.
You've failed.
Let's see you crack this:
I append
'fahrpghuerigh;4A$FE%gERGSUGI%PFH%FAHgfuoaghfu4.fgrvhjkhjzdfgvo8et7rfgAA$F*YROAGSY?R*OSGSERGJAIRgf'
before the string and
'hfphgasp9rhy4GFRG(GUZ%IJGJ%VW%G@$GT^$@*%)%@*!@%hf87ohs780erhss805ryg7u5sgwh54fqhj,fgq4f'
after the string. Well, my input has now become
'fahrpghuerigh;4A$FE%gERGSUGI%PFH%FAHgfuoaghfu4.fgrvhjkhjzdfgvo8et7rfgAA$F*YROAGSY?R*OSGSERGJAIRgfBLABLABLABLABLAhfphgasp9rhy4GFRG(GUZ%IJGJ%VW%G@$GT^$@*%)%@*!@%hf87ohs780erhss805ryg7u5sgwh54fqhj,fgq4f'
Good luck attempting to create a collision as well, since you have to consider the prepended and appended …
I have been using InnoDB then since suggested in this topic and restarted the mysql service while a record was being inserted then there was no corruption. So InnoDB is the choice for when corruption is a problem.
Thanks.
*Solved*