Jump to content

Taorluath

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Taorluath's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Woohoo! Thanks you guys, this forum rocks!
  2. So here's the deal: I'm designing this kind of 'chat bot' in php. I want it to evaluate various ways of saying the same thing, such as "no" and "No", before it responds. I could have an 'if' statement that covers every possible input by itself, but that seems very unwieldy. if ($test==("no" or "no." or "no!" or "No" or "No." etc...)) I've been trying to make a multidimensional 'or' expression, but it seems like any second-level 'or' statement is just considered always true. Like with this: $a = ("." or "!"); //$a is always true if ($test==("no".$a)) { //also always true Below is what I'm kind of trying to get. $test should have to be either "no.", "no!", or "NO" to get the first response. Instead, it always outputs "you entered no". if ($test==("no".("!" or ".") or "NO")) { echo "you entered no"; } else { echo "yes?"; } I like how with regex, it could be something like "no(.|!)", can you do this with php?
  3. I found a Listen 80 in my ports.conf file. I changed it to 8080 there and on the port forwarding thing on my router. Now when I go to my external IP it doesn't load forever, it just goes straight to the router setup again. How come changing the port did this? How do you change the port the right way and still get it to show up as web page?
  4. That's what other forums have told me as well. But how do I change all the settings to get Apache to output to a different port? Is there just one file I can edit to get this change, or do I have to edit many of them?
  5. Ok, so I tried going to my site through a proxy, and I still got the same problem.
  6. Yeah, I know I didn't use sudo. But wait, you're saying that without adding something to my hosts file, only people OUTSIDE my network see my website?? And what line should I add to hosts, so that I can see it from inside?
  7. I also got this when I forgot to use sudo, if this helps: bleh bleh@server:~$ /etc/init.d/apache2 force-reload open: Permission denied * Reloading web server config apache2 httpd not running, trying to start (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs open: Permission denied
  8. Wait, what do you mean? If i don't forward the port, how can I see it from outside? Do you mean I should check my external ip after I forward it from outside? Shouldn't I be able to see my site from the inside as well? ???
  9. Here is my situation: I have Apache and everything nicely installed on my Linux box. I've been running it only on my computer, not the web, testing out PHP and Mysql etc. I haven't changed much of the default settings and now I want to host it to the web. I also have a SSH server which I have successfully accessed from computers not in my network. The linux box has a static IP and everything too. So I go to my external IP address, and it gives me the router setup. I go down and turn on the port forwarding that forwards port 80 to the linux box's static ip, right underneath where I did it for the SSH. I save the settings, but when I go to my external ip again, instead of seeing my site-- or the router setup again, for that matter-- it just goes into an infinite loading sequence. It never loads anything. How do I get my Apache to the outside world? ???
  10. Yeah, I'm using Xubuntu, so that makes sense. Ok, now I get it, I found the file you're talking about. It's in /etc/apache2/sites-enabled. Thank you guys so much for the help!
  11. If you're doing anything with Apache, everyone says to edit you httpd.conf file. However, my /etc/apache2/httpd.conf is remarkably empty. This is the entire content: ServerName localhost <Directory /www/htdocs/yoursite> AllowOverride FileInfo </Directory> I've never even had a site at /www/htdocs/yoursite! However, my /etc/apache2/apache2.conf is much more full. This is the beginning bit: # # Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.2/ for detailed information about # the directives. The apache2.conf file seems to be the one that operates, since I changed the 'ServerTokens Full' line to 'ServerTokens Major' and it worked. Why is it called apache2 for me, when for everyone else it's httpd?? Also, I've heard that taking out 'Indexes' from <Directory "/var/www/html"> Options Indexes FollowSymLinks </Directory> will make it so people can't see all the files in my directory. So I added this to the end of my apache2.conf: <Directory "/home/server/mysite"> Options FollowSymLinks </Directory> But it still displays all the files in any directory! How do I fix this?
  12. Kind of along the same lines: Is there some kind of way I could read the html of a website from a php script? Like for example, it could tell me the alternate text on the google logo at google.com. You know, like if it was some holiday, the alt text for the image would be different. Could a php script do that?
  13. Wow! Thanks, that works great! I'm a just novice Mysql user, could you tell me where can i learn tricks like that?
  14. So here's the deal: I have a blog database that I made myself. The post date is included as a field in my database. It's stored in the usual YYY-MM-DD format. I want it to be displayed easier to read, like: Jan 2nd, 2008. I'm trying to get DATE_FORMAT() to make it look better, but I can't seem to get it to work. Here's my code: $sql = "SELECT id, poster, DATE_FORMAT(post_date, '%b %D, %Y'), post_name, post_text, current_location FROM blog_posts ORDER BY post_date"; $res = mysqli_query($mysqli, $sql); post_date is the field that has the date stored in it, btw. WHat's going wrong?
  15. I'm trying to make a PHP script that increases the blue value of each pixel in an image by 1. It's important that the script goes pixel by pixel. For some reason, however, it outputs an image that is one solid color; a brownish red block. Why isn't this script only slightly increasing the values?? ??? ??? <?php $img = imagecreatefromgif('logo.gif'); // get height and width $h=imagesy($img); $w=imagesx($img); //display image echo "<img src='out.gif' />"; //cycle through every pixel and add 1 to the blue value of the pixel's rgb value $y=1; while($y < $h) { $x=1; while($x < $w) { $rgb = imagecolorat($img, $x, $y); $red = ($rgb >> 16) & 0xFF; $green = ($rgb >> & 0xFF; $blue = $rgb & 0xFF; $blue++; //define the new color and assign it to the pixel //this is where things go wrong $color = imagecolorallocate($img, $red, $green, $blue); imagesetpixel($img, $x, $y, $color); $x++; } $y++; } echo imagegif($img, 'out.gif'); ?> I know the problem is in these two lines by the way. $color = imagecolorallocate($img, $red, $green, $blue); imagesetpixel($img, $x, $y, $color);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.