Jump to content

XeroXer

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by XeroXer

  1. Hi there! I am making a download directory that demands that the user is logged in. Got any idea on how to either randomize a download link for every user download or to make the exact file link never show. Really need help with this and I haven't found a good system for this yet.
  2. [b]EDITED:[/b] Hi all I need some help with my user site. When users log in to the site it should store the users ip. My problem is to make it not to store the ip multiple times and if it adds an ip just
  3. Thanks that worked perfect...
  4. OMG what a miss. Thanks a lot it worked... Great to know that there are always people here to help. :) [b]EDIT:[/b] What happens now if the username already exists? It will still enter it again right? Any idea on how to make it check first?
  5. Hi! I have a problem inserting information into my database. I am making a login site and the problem I am having is regarding the registration process. My database looks like this: [code]CREATE TABLE `v2_users` ( `id` int(5) NOT NULL auto_increment, `name` varchar(65) NOT NULL default '', `pass` varchar(65) NOT NULL default '', `jdate` varchar(65) NOT NULL default '', `banned` varchar(5) NOT NULL default '0', PRIMARY KEY  (`id`), KEY `name` (`name`,`pass`,`jdate`,`banned`) ) TYPE=MyISAM AUTO_INCREMENT=2 ;[/code] This might look strange and thats because I'm not used to using my database that much. The code I use for inserting information is this: [code]include("config/database.php"); $password = md5($password); $con = mysql_connect("$mysqlhost","$mysqlusr","$mysqlpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($db_name, $con); mysql_query("INSERT INTO v2_users (name, pass, jdate, banned) VALUES ($username, $password, $date, '0')"); mysql_close($con); echo "Registration completed. You can now log in...";[/code] I have a feeling I have done something wrong but I get no error. So please help me...
  6. Changed that now. Get no error but still no output from the file.
  7. [code]Parse error: syntax error, unexpected '{' in /customers/xeroxer.com/xeroxer.com/httpd.www/_/-/search/test.php on line 11[/code]
  8. [quote author=Orio link=topic=116606.msg475712#msg475712 date=1164820112] Remove the ; from: if(ereg($searchFor, $line); Orio. [/quote] Then I get: [code]Parse error: syntax error, unexpected T_VARIABLE in /customers/xeroxer.com/xeroxer.com/httpd.www/_/-/search/test.php on line 9[/code] line 9 being: [code]$cols = explode(":", $line);[/code]
  9. I can give you an example of the rows... [code]b1ed9d52b23577a036c9591cdac0194a:counter-strike(v.3).gif:[C]ounter-[S]trike game loader version 1$2. (gif)[/code] zanus: [code]Parse error: syntax error, unexpected ';' in /customers/xeroxer.com/xeroxer.com/httpd.www/_/-/search/test.php on line 8[/code]
  10. Added that row and still I get nothing printed out. Is there any character that would destroy this script? Make it not being able to search? PS If you have time tomorrow I would appreciate it if you would help me then. :-)
  11. Who won't this output anything? [code] <?php $text = file_get_contents('file.txt'); $text = nl2br($text); $regex = "/\n(.*?):(c944):(.*?)\n|\n(c944):(.*?):(.*?)\n|\n(.*?):(.*?):(c944)\n/is"; preg_match_all($regex,$text,$matches); foreach($matches[0] as $row) { $temp = explode(":",$row); echo "First = ".$temp[0]."<br>Second = ".$temp[1]."<br>Third = ".$temp[2]."<br><hr><br>"; } ?> [/code]
  12. I want to smash my computer to bits. Still won't work........
  13. this is driving me crazy. my code now looks like this: [code]<?php $text = file_get_contents('file.txt'); $regex = "/\n(.*?):(5678):(.*?)\n|(5678):\n(.*?):(.*?)\n|\n(.*?):(.*?):(5678)\n/is"; preg_match_all($regex,$text,$matches); foreach($matches[0] as $row) { $temp = explode(":",$row); echo "First = ".$temp[0]."<br>Second = ".$temp[1]."<br>Third = ".$temp[2]."<br><hr><br>"; } ?>[/code] And I get no result. I also noticed that when I echo the code it doesn't show the rowchanges I have in my .txt file. It just prints it all out with automatic rowchange here and there...
  14. Actually no. :) The lenght differs from row to row. I think the longest infostring so faar is 55 characters.  ::)
  15. If I type echo $text I get all the file content printed out yes. Is there any limitations regarding what letters, numbers och signs that can be used in the file? Because now the first part consists of just letters (small and large) and number. The second and third part is just about any sign you can get into a filename. For example: []()$-_
  16. When they get to the login page you can set a session variable: [code]$_SESSION['page'] = $_SERVER['HTTP_REFERER'];[/code] Then when you list the continue text just use: [code]echo 'Success, you have been logged in!<br />'; echo '<a href="'.$_SESSION['page'].'">Continue</a>...'; # Give a message of success[/code] This will redirect them to the page they where when they need to login. Hopefully this will work. I am no king on php but..
  17. I can't get that to work. I did like this: [code]<?php $text = file_get_contents('file.txt'); $regex = "/([a-z0-9]+):(5678):([a-z0-9]+)|(5678):([a-z0-9]+):([a-z0-9]+)|([a-z0-9]+):([a-z0-9]+):(5678)/is"; preg_match_all($regex,$text,$matches); foreach($matches[0] as $row) { $temp = explode(":",$row); echo "First = ".$temp[0]."<br>Second = ".$temp[1]."<br>Third = ".$temp[2]."<br><hr><br>"; } ?>[/code] and it prints out nothing...
  18. Hi there! I have a textfile containing different information strings. The content is listed like this: [code]abcd:dcba:1234 4321:efgh:hgfe 5678:ijkl:mnop ponm:8765:lkji[/code] ... Well you get the point. I want to be able to search with a php script in this file. The row/rows containing the search string should be listed by the script. So if I would have searched in the above file for [color=red]5678[/color] I would get this result listed: [code]5678:ijkl:mnop[/code] But as I wrote is must be able to handle multiple rows containing the string. I also want so that the different parts of the search string should be divided by some colorcode. Like this: [color=red]5678[/color]:[color=blue]ijkl[/color]:[color=green]mnop[/color] Can anyone do this or help me with the commands to do it myself?
  19. Hmm. Might be an idea. Any tips on a certain one?
  20. Hi there! I have a clanscript where an admin can enter information about all the players and it gets saved to a textfile. THe trouble comes when he wants to edit the info he entered. Since he isn't good on html and the only way I know to show this is listing the whole file content in a textarea this becomes a problem. I have a database but isn't going to use it with this project. The person who wants this script does not have a database on his site so that's why I'm making without. Anyone have any tip on listing file content in a good way so editing and deleting will be easy? Every entry is one row in the file and looks something like this: [code] <tr height="18" bgcolor="#000000"> <td align="left" valign="middle" width="18"><img src="cs.gif" width="16" height="16" title="Counter-Strike" alt="Counter-Strike"></td> <td align="left" valign="middle" width="18"><img src="country/se.gif" width="16" height="11" title="Sweden" alt="Sweden"></td> <td align="left" valign="middle" width="265">Karl '<strong>User1</strong>' Sturesson</td> <td align="left" valign="middle" width="18"><img src="minus.gif" class="showstate" onClick="expandcontent(this, 'user1')"></td> <td align="center" valign="middle" width="45">age: 25</td> <td align="right" valign="middle" width="18"><img src="msn.gif" width="16" height="15" border="0" alt="msn@msn.com" title="msn@msn.com"></td> <td align="right" valign="middle" width="18"><a href="irc://se.quakenet.org/ircchannel" title="#ircchannel"><img src="mirc.gif" width="16" height="15" border="0" alt="#ircchannel"></a></td> </tr> <tr height="72" bgcolor="#000000" id="user1" class="switchcontent"> <td colspan="7" align="left" valign="top">Info for user number 1.</td> </tr> [/code] To make it easier for you to see what it contains I but som rowchange in there. But in the file all this is on one single row. The javascript is part of an expand/contract menu so it's supposte to be ther :)... If anyone could help me with a better way to edit multiple entrys in a textfile I would be ever so thankfull...
  21. Another question then? What command do I use to delete a file? And how do I list the content of a folder in a drop-down menu?
  22. Hi there! I ma making a simple site for a friend of mines counter-strike clan. Verything is done from his point of view but I think that one thing is missing. I have allowed them to upload images and insert them into members sections. Now I also want to add so that they can delete the images. If they upload one file named member1.gif I haven't added any option to overwrite it the next time so it displays an error. So then they rename the image to member1-1.gif and it goes on and on. So I want to add a delet file section. And I though what better place to fix it than here. The security section is already done so all I need is the delete "sequence" :). The file will be placed in a folder named clan and then in that folder there will be a file called upload with all the images in. I want a PHPscript that reads the content of that foler and lists it in a drop-down menu. There you choose the filke you wish to delete and press delete (submit). The file should then be deleted and a success message should be printed out. If anyone can make this, has it laying around or could give me pointers so I can make it myself I would be very happy.... :) Have a nice day all!
  23. oh... :-( So there is no way to do a timed event like this just through php? Or any other way you can suggest? Because I really need to make this automaticly. I can't sit three times a day every day writing down ite statistics...
  24. Can I see that in the phpinfo or do I have to ask them? And if they do not allow it I can't do it? Anyone know any free hosting site who allows it? I don't wanna print the info out anywhere I just want it stored in a textfile for further use by me...
  25. Is it possible somehow to create a php script that runs on certain times every day. I am planning on making a script that reads stats from two sites for later comparresing. Reads the data and stores it in either my database or a textfile. I want it to read and save the data three times a day and automaticly. Anyone got any tips on how to do this?
×
×
  • 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.