-
Posts
1,216 -
Joined
-
Last visited
Everything posted by WebStyles
-
need to echo all word combinations from the input
WebStyles replied to tastro's topic in PHP Coding Help
please post the code you already have along with whatever errors you're getting. -
PHP membership registration form
WebStyles replied to palmspringsasian's topic in Third Party Scripts
We cannot guess what's wrong without seeing what you've done. please post your code. -
then switch the array around.. instead of: $ent = array( 'Ć'=>'Ć', do this: $ent = array( 'Ć'=>'Ć',
-
Need Help For Scouts Site Needs To go up in 30mins
WebStyles replied to Reece112233's topic in PHP Coding Help
post your code please -
try this: <?php session_start(); $username = trim($_POST["user"]); $password = trim($_POST["pass"]); $login = trim($_GET["login"]); setcookie("username","$username",time()+86400); if($login == "yes"){ $con = mysql_connect("localhost","root","arceye") or die('Cannot connect to server...'); mysql_select_db("login",$con) or die('Cannot select that database...'); $get = mysql_query("SELECT count(`id`) as total FROM `login` WHERE `user`='$username' and `pass`='$password'",$con) or die(mysql_error()); $res = mysql_fetch_assoc($get); @mysql_close($con); $result = $res['total']; if($result !=1 ){ echo "Invalid Username Or Password"; exit(); }else{ echo "Login Successful" $_SESSION["username"] = $username; } } ?>
-
That code gives me the following output: ĆćČčĐ𩹮ž (printed on screen) ĆćČčĐ𩹮ž (source view) So it seems its working. your problem must be somewhere else.
-
should be something like: $data = array_slice(file('data.txt'), 0, -5, true));
-
check your logs and post the error here please.
-
if you know how to get the last five lines, do the reverse, get all the lines except the last five, and write the whole thing to the file (replacing all content)
-
This should work. (Because I'm combining two types of quotes, there's no need to escape the double quotes here) <?php echo '<a href="'.$r['feedusername'].'"><img src="'.getUserAvatar($r['feedusername']).'" class="avatar mediumsmall newspadding f_left mrl" title="'.$r['associate_name'].'" alt="'.$r['associate_name'].'" /></a>'; ?>
-
Gathering Print Outs Of URL Links In <DIV>?
WebStyles replied to happyhippy's topic in PHP Coding Help
Something like this? preg_match_all('/\<div id=web\>(.*?)\<\/div\>/is', $page, $matches); where $page contains the whole page's code. $matches will be created as an array containing the results. (not sure if you also need to escape the = sign). -
date("W"); will return the week's number. Since your page is based on weeks, it could make sense to store the week along with the meeting date. You could run a script, to check the week number of each meeting date: $weekNr = date("W",strtotime($meetingDate)); and add a WeekNr field to your database to store the returned values, then slightly change you original script to also include the week number when inserting new meetings. That way all you'll need to do in the future is something like: select * from `table_name` where `weekNr` = '$week' (weekNr should be defined as an index, so speed up searches)
-
what is the objective of this? $text = $_POST["post_desc"]; $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text);
-
this line if(!isset($_POST["post_desc"]) || $_POST["post_desc"] = ""){ should be if(!isset($_POST["post_desc"]) || $_POST["post_desc"] == ""){ (two equal signs) * I didn't check the rest, since this was the first bug I found and may solve your problem.
-
there's yet another option, which is a variation of one of the previous. As the182guy said: you could do this, but call a script on the server and send it the url of where the file resides at the moment. This way, when users visit you site, they will see ALL uploads available, even though some of them have not yet been moved to the server, they can still be downloaded. then when the cron job finally executes, you also change the url to the appropriate path.
-
Just a comment: "page 10 after 1 click"? I would expect page 2. You seem to be counting articles/posts and not pages, but even then, if you display 10 at each time, then the next page would start with article 11, and not 10... Having the correct page number in the url is sometimes useful for users to jump between pages just by changing the number (I know I do that a lot on other sites). Having page 10, 20, 30, 40 will mislead the user into thinking there are a lot of pages in between that he's not seeing. Also, if you mean 'article' instead of page, you should probably rename your variables so that they make sense.
-
had to look that up... Advanced Dungeons and Dragons? lol. Nope, never played it. Man I'm from the days of the spectrum, I used to play Chuckie Egg and Manic Miner... No dice involved, just mad skills!
-
how to show list of files uploaded by current session user.
WebStyles replied to addyking's topic in PHP Coding Help
Once again: I cannot tell you if you'll need to join two tables or not without seeing your database structure. If your structure is properly built, you might have a table dedicated to file uploads, and in that case all you need is something like: select `fileId`,`filePath`,`fileDescription` from `uploads` where `userId` = $_SESSION['userId'] -
how to show list of files uploaded by current session user.
WebStyles replied to addyking's topic in PHP Coding Help
that is your html code, I asked for the code that stores files, so I can see the database field names. -
it's the same thing... imagine everything inside the () is an echo.