Jump to content

speedy_rudolf

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by speedy_rudolf

  1. Yeah...thanks....I already knew that....what I'm trying to do now is find a way to solve it....
  2. Thanks...But I have already tried everything you said, so....
  3. I already said it's not a router problem, as it is already configured from the first try at the server when everything was working fine, except for a few processing bugs.
  4. Hi. I'm trying to build a home server using Microsoft Windows Server 2008 R2, Apache 2.2, PHP 5.2, MySQL 5.5. The server works fine localy. The problem is accessing it externaly (from LAN / Internet). I can't get my other computer (both connected through a router) to "see" the server. The problem isn't with the router (I had to reinstall the Windows to solve some problems ...the first time I was using IIS and I could see the site from LAN/Internet and I didn't change any settings in the router) or the firewall (I have disabled both PC's firewalls for testing purposes). So I'm guessing it might be an Apache setting problem, but I can't figure out what (I created a virtual server for the site using localhost as the domain name as I have read that this might be a cause, but no luck). Any idea what the problem might be and how to solve it? Thank you in advance. Bye. PS: I don't know if this helps, but I can't even ping one PC from the other.
  5. Hi. I'm using Microsoft Windows Web Server 2008 R2. I have setup IIS7.5, PHP 5.2 and Mysql Enterprise Edition 5.5 successfuly. The problem I'm having now is getting the SMTP server to work. Using the code: <?php $to=""; $from=""; $subject="Contact"; $message="Nume: $_POST[name] Email: $_POST[mail] Mesaj: $_POST[msg]"; if(mail($to, $subject, $message, $from)) {header("Location: site.html");} else {echo ("Mail could not be sent.<br><br> <a href='site.html'>HOME</a>");} ?> writes in the log entries that everything is ok and creates the mail in the queue folder, but doesn't send it (it gets stuck in the queue). Using the code: <?php $to = ''; $subject = 'TEST mail'; $message = 'Hello. This is a test email from me.'; $headers = 'MIME-Version: 1.0' . " "; $headers .= 'Content-type: text/plain; ' . " "; $headers .= 'To: Rudolf <>' . " "; $headers .= 'From: Contact <>' . " "; mail($to, $subject, $message, $headers); ?> writes the same log entries (everything ok) but creates the mail in either BadMail or in queue (in which case the mail sits there for a few minutes then disappears, but nothing reaches the recipient) or doesn't create a mail at all (but the log entries are always consistent). I have granted permisions in Connection to 127.0.0.1 and in Relay to 127.0.0.1 and localhost. I have allowed port forwarding on my router on port 25 and my ISP isn't blocking port 25. Any idea why this might be happening and how to solve it? Thank you in advance. Bye.
  6. Hi. I have the following code: <?php $host=""; $username=""; $password=""; $db_name=""; $tbl_name="topic"; // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $name=$_POST['name']; $detail=$_POST['details']; $sql="INSERT INTO $tbl_name(topic, detail, datetime)VALUES('$name', '$detail', NOW())"; $result=mysql_query($sql); if($result){ echo("Topic created. "); $sql3="SELECT max(id) FROM $tbl_name"; $result3=mysql_query($sql3); $tbl_name2="top_img"; for($i=1; $i<11; $i++){ $uploaddir = '/imgs/'; $uploadfile = $uploaddir . basename($_FILES['img'.$i]['name']); echo '<pre>'; if (move_uploaded_file($_FILES['img'.$i]['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } }} echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; echo("<br><br><a href='site.html'>HOME</a>"); ?> And the error message: Any idea what the problem might be? Thanks in advance. Bye.
  7. Yes, I am using IIS. I have tried naming it *.php, that just gives me a "500" error. As for the configuration, how can I configure it so it also handles scripts within html? (I haven't tried inserting a handler for html, but I guess it would also give me the "500" error.)
  8. Hi. I'm fairly new to server management, so bear with me (and sory for my english). I'm have successfuly installed and configured Windows Web Server 2008 R2 and PHP 5.3.5 (I know it works because I can run *.php files/scripts just fine), but I have one problem. It doesn't run php scripts within *.html files. Let's consider the following code: <html> <head><title>TITLE</title></head> <body> <?php echo("Hello ");?> world! </body> </html> The output to the above code is: Does anyone know how to solve this problem? Thank you in advance. Bye.
  9. Figured out how to make the onmouseover to work.... Now what about the "rows as links" part? Any ideas how to make that work? More specifically, I what to use as link the entire cell (background+text, not just text).
  10. Hi. I've been working on a project for some time now, and just recently I installed Firefox. Now, part of the site (which works perfectly in IE6/7) doesn't work in Firefox. Here is part of the code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Meniu de navigare</title> </head> <body bgcolor="#000437"> <table width="119" style="position:relative; top:35%"> <a href="pag_start.html" target="continut"><tr><td class="nav_bar" height="24" background="p1.png" valign="center" onmouseover="background='p2.png'" onmouseout="background='p1.png'" onmousedown="background='p3.png'" onmouseup="background='p2.png'">Home</td></tr></a> blah blah blah </table> </body> </html> (I didn't copy all of the code because it's basically the same all the way down) The main problem is with the link (Firefox apparently doesn't recognize table rows as links). The second problem is with the onmouseover/onmouseout etc handlers (absolutely nothing happens). Any ideas how to solve this? Thanks. Bye. PS: just in case you need to know, the code is for a nav bar.
  11. Hi. I think you all know me by now so I'll cut to the chase. <?php $host="edited"; $username="edited"; $password="edited"; $db_name="edited"; $tbl_name="topic"; // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $name=$_POST['name']; $detail=$_POST['details']; $sql="INSERT INTO $tbl_name(topic, detail, datetime)VALUES('$name', '$detail', NOW())"; $result=mysql_query($sql); if($result){ header("location:site.html");} else{ echo("I have failed you master.");} ?> Displayed error: "I have failed you master." Anyone know a possible cause? Thanks. Bye.
  12. no. The "error" occures before the record being inserted. yeah...as it turns out, it was an error/bug on the server's end. it couldn't correctly process the form. it works just fine now. thanks.
  13. no. The "error" occures before the record being inserted.
  14. Hi. I'm trying to build a sort of blog where users have to register to post questions/comments. My problem is with the registration part. Here is part of the code: <form name="registration" method="post" action="registration.php"> <tr><td align="left">Nume</td> <td align="right"><input type="text" name="name" onKeyUp="validare()"></td></tr> <tr><td align="left">Email</td> <td align="right"><input type="text" name="email" onKeyUp="validare()"></td></tr> <tr><td align="left">Username</td> <td align="right"><input type="text" name="username" onKeyUp="validare()"></td></tr> <tr><td align="left">Parola</td> <td align="right"><input type="password" name="password" onKeyUp="validare()"></td></tr> <tr><td align="left">Confirmare parola</td> <td align="right"><input type="password" name="pass_conf" onKeyUp="validare()"></td></tr> <tr><td align="left">Anti-spam</td> <td><script type="text/javascript">DrawBotBoot()</script></td></tr> <tr><td></td><td><input type="submit" name="register" value="Inregistreaza-te" disabled="true"></td></tr> </form>... </html> <?php $host="mysql3.***************"; $username="a7129718_root"; $password="hello2"; $db_name="a7129718_site"; $tbl_name="members"; // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT MAX(id) AS Maxa_id FROM $tbl_name"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); if ($rows) { $Max_id = $rows['Maxa_id']+1;} else { $Max_id = 1;} $name=$_POST['name']; $email=$_POST['email']; $user=$_POST['username']; $pass=$_POST['password']; $sql2="INSERT INTO $tbl_name(id, name, email, username, password)VALUES('$Max_id', '$name', '$email', '$user', '$pass')"; $result2=mysql_query($sql2); if($result2){ header("location:login.html");} else{ echo "cannot insert into table";}} ?> The problem is: there is no error message. The server just redirects me to their error page, which doesn't contain any error code, just some ads. Can you tell me what the problem might be? Thank you in advance. Bye."
  15. Nope. Doesn't work. I tried copying the, changing the code, rewriting the code from scratch (using your code as a guideline), but still nothing. At best, it just takes me right back to my original problem, but most often it just gives me an error. Thanks anyway. Hope someone else can give me another idea. I finally did it Here is the code mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY id DESC"; // OREDER BY id DESC is order result by descending $result=mysql_query($sql); ?> <table width='50%' border="0" align="center" cellpadding="3" cellspacing="1"> <?php $limit=10; $page=0; $numrows = mysql_num_rows($result); $pages = intval($numrows/$limit); if ($numrows % $limit) { $pages++;} $page=$_GET ; $limitst=10; if(empty($page)){ $limit=$limitst; $oldlimit=0; $page=1; }else{ $limit=$page*$limitst; $oldlimit=$limit-$limitst; } $result = mysql_query("SELECT * FROM $tbl_name ORDER BY id DESC LIMIT ".$oldlimit.",".$limitst); while($rows=mysql_fetch_array($result)){?> <tr><td><font size="+2"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></font></td> <td width='0*'><? echo $rows['datetime']; ?></td></tr> <tr><td><? echo substr($rows['detail'], 0, 250)."..."; ?> <a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo "Citeste mai mult";} ?></a> </td></tr> <tr><tr><td> <? if($pages == 1){ echo "<b>1</b>"; }else{ for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { if($i == $page){ echo("<b>$i</b>\n");} // If current page don't give link, just text. else{ echo "<a href=\"$PHP_SELF?page=$i\">$i</a> \n"; } } } ?> </td></tr></tr><?php mysql_close(); ?> </table> Thank you very much every one for your ideas
  16. Nope. Doesn't work. I tried copying the, changing the code, rewriting the code from scratch (using your code as a guideline), but still nothing. At best, it just takes me right back to my original problem, but most often it just gives me an error. Thanks anyway. Hope someone else can give me another idea.
  17. Hi. I'm trying to make a sort of a forum, and this is the part of the code that needs to be changed, only I don't know how. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY id DESC"; // OREDER BY id DESC is order result by descending $result=mysql_query($sql); ?> <table width='50%' border="0" align="center" cellpadding="3" cellspacing="1"> <?php $limit=10; $page=0; $numrows = mysql_num_rows($result); $pages = intval($numrows/$limit); if ($numrows % $limit) { $pages++;} $current = ($page/$limit) + 1; if (($pages < 1) || ($pages == 0)) { $total = 1;} else { $total = $pages;} $result = mysql_query("SELECT * FROM $tbl_name ORDER BY id DESC LIMIT $page,$limit"); while($rows=mysql_fetch_array($result)){?> <tr><td><font size="+2"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></font></td> <td width='0*'><? echo $rows['datetime']; ?></td></tr> <tr><td><? echo substr($rows['detail'], 0, 250)."..."; ?> <a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo "Citeste mai mult";} ?></a> </td></tr> <tr><tr><td> <? if ($page != 0) { // Don't show back link if current page is first page. $back_page = $page - $limit; echo("<a href=\"$PHP_SELF?query=$query&page=$back_page&limit=$limit\">back</a> \n");} for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page){ echo("<b>$i</b>\n");} // If current page don't give link, just text. else{ echo("<a href=\"$PHP_SELF?query=$query&page=$ppage&limit=$limit\">$i</a> \n");} } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link. $next_page = $page + $limit; echo(" <a href=\"$PHP_SELF?query=$query&page=$next_page&limit=$limit\">next</a>");} ?> </td></tr></tr><?php mysql_close(); ?> </table> I made a database with 4 fields and 11 entries. The script shows the last 10 entries just as it should, but when I click on the 'next' button, nothing happens (it should show the first entry, but it just refreshes the page, and still the last 10 entries/1st page are shown). I think it has something to do with the link, but I can't figure out what exactly. Can someone help, or at least give me a hint? Thanks in advance. Bye.
  18. Thanks for the heads up. And I just found out what was wrong with my script (I was missing the cookie path=/)
  19. Hi. I'm trying to make a website where people have to login to be able to see some contents. But I kind of got stuck. I'm trying to use cookies, but I can't get them to work. (The following code is to test if the cookies/site work) Login page: <html> <head> <script language="javascript"> <!-- function setcookie(){ document.cookie = "logged="+escape("Dom Director") window.location = "/site.html"} </script> </head> <body onload="setcookie()"></body> </html> Site Page: <html> <head><title>TITLU</title> </script> <script language="javascript"> <!-- function getCookie(cookies){ var results = document.cookie.match ( '(^| ?' + cookies + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null;} </script> </head> <body> <table width="100%"> <tr height="150"></tr> <tr><td width="150">bara navigatie</td> <td width="0*"><img src="400p.png"> <script>if (!getCookie('logged')) document.write('You're not logged in.') else document.write('Hello , '+getCookie("logged"))</script> The problem is that it doesn't matter if I load the site page or the login page, I only get "you're not logged in", so either the cookie isn't being set, or the search doesn't find the cookie. Any help will be very much appreciated. Bye.
  20. Hi. I'm trying to design a "security system" for a program. Basically, the user has a custom built usb memory stick. When he/she wants to use the software, he/she has to first insert the memory stick into a usb port. Then, when the program is opened, it checks to see if the memory stick is in the correct "layout" (in this example it has a 32 mb memory chip and a 64 mb memory chip), then runs some apps from the memory stick. Anyway, the problem is, how do I get the "layout" of the stick (that is, check to see if the memory chips are from a genuine security stick)? Is there any way to do this? Or should we consider other options? Thank you in advance. Bye. PS: the programming has to be in c++, c# or assembly
  21. HTML: <form method="post" action="upload.php" name="site" enctype="multipart/form-data"> <input type="radio" name="Layout" value="Fisier" onClick="Val_layout();Cont_pag1();">Trimite fisier<br/> <table id="Sl_f" style="display: none"><tr><td><input type="file" name="Fis_lay" size="100" onChange="Cont_pag1()"></td></tr></table> <input type="radio" name="Text" value="Fisier" onClick="Val_text();Cont_pag2();">Trimite fisier<br/> <table id="St_f" style="display: none"><tr><td><input type="file" name="Fis_txt" size="100" onChange="Cont_pag2()"></td></tr></table> <input type="submit" name="Finalizare" value="Finalizeaza Comanda" disabled=true> Well...that's just a small part of the code...the entire file has about 80k so i'm not going to post that. [attachment deleted by admin]
  22. OK...here's what happened: I used the form (for debugging), after about 2 minutes after I hit the submit button the php script launched, but the files took another 4 minutes to upload.
  23. Hi. I'm making a website with multiple file inputs. The problem is submitting the form: if the user selects big files (eg: 3-4mb), when he submits the form, the php script is launched before the files have uploaded completely. How can I launch the script AFTER the file have uploaded (something like onfileupload or something like that)? It can be any language (html, javascript, php). Thank you in advance. Bye.
  24. they were already set: $headers="From: $from"; $semi_rand=md5(time()); $mime_boundary="==Multipart_Boundary_x{$semi_rand}x"; $header.="\nMIME-Version: 1.0\n"."Content-Type: multipart/mixed;\n"."boundary=\"{$mime_boundary}\"";
  25. Hi. I have the following code: else if(file_exists("site".$timp.".zip")) {$file=fopen("site".$timp.".zip", "rb"); $data=fread($file, filesize("site".$timp.".zip")); fclose($file); $data=chunk_split(base64_encode($data)); $message.="Content-Type:{\"application/octet-stream\"};\n"."name=\"site".$timp.".zip\"\n"."Content-Disposition: attachment;\n"."filename=\"site".$timp.".zip\"\n"."Content-Transfer-Encoding: base64\n\n".$data."\n\n"; $message.="--{{$mime_boundary}\n"; unset($data); unset($file); if(mail($to, $subject, $message, $headers)) {header("Location: comanda_primita.html");} The problem with it is, there is no attachment. Instead, at the end of the mail I get: Does anyone know what's wrong with the code? Thank you in advance. PS: This script also sends multiple attachments (if there are multiple files)...But since it doesn't send even one attachment....
×
×
  • 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.