
Mistral π€
Members-
Posts
104 -
Joined
-
Last visited
Never
Everything posted by Mistral π€
-
Sorry about the delay. Why not just convert it to the way I had it, and the way you want it, in English first and then use the function on it?
-
[SOLVED] Accessing Url Information(Domain Name)
twostars replied to Finalfantasykid's topic in PHP Coding Help
-
GD library's imagefill function might do the job, though you'd need to know where to start filling.
-
<?php function en2sw($date) { $en2sw = array( "January" => "Januari", "Sunday" => "SΓΆndag" ); if (!empty($en2sw[$date])) return $en2sw[$date]; else return $date; } echo en2sw("January"); ?> Usage is pretty self explanatory.
-
Remove from the above code "LIMIT $offset, $rowsPerPage" Also, you can use $query_rs_paging .= "ORDER BY....... instead of $query_rs_paging = $query_rs_paging .
-
Not really a bad habit, but its easier to see the quote button than the reply button. Also easier to see what I'm replying to, as opposed to scrolling down the page.
-
I don't have a clue where the .users has come from :/ print_r($db->query("select * from `users` where `username` = 'admin'")); If your database name is civ_table (weird name for a database though), then it all makes sense.
-
In all of my scripts lately, I gather the data together into a variable, and output them into a HTML document, which is located in another folder. To do this, I use sprintf() a lot. This way, I can easily modify headers and stuff before anything is really sent to the user, plus I get an easy-to-change layout. So, in relation to your question, I can define $title whenever I like. The final result will be outputted along with the rest of the stuff, and will be filled into the pre-made template document.
-
In that instance, I believe the function you are wanting to use is: file_exists(); But then, you need to use an absolute or relative server path. Such as: ./html/image3.jpg < relative or C:\Apache2\htdocs\html\image3.jpg < absolute or /home/mydomain/htdocs/html/image3.jpg < *nix absolute
-
Occasionally I forget about addslashes and use this: <?php # Input echo "Original message: {$_POST['message']}<br />"; $message = str_replace("'", "`*+", $_POST['message']); # Where the second parameter is a string that is unlikely to be used at all. $message = str_replace('"', "#%&", $message); echo "After input conversion: {$message}"; # Output $message = str_replace("`*+", "'", $_POST['message']); # Where the second parameter is a string that is unlikely to be used at all. $message = str_replace("#%&", '"', $message); echo "After conversion back to output: {$message}"; ?> Of course, its very tedious to remember but eh.. it works.
-
Why don't you just let the popup window use a vertical scrollbar?
-
Okay then, in pseudocode: Script to get all 'posts': <html> <head> <title>Title that won't be shown but good to have anyway</title> <meta http-equiv="refresh" content="5"> </head> <body> <?php mysql_connect("host", "user", "password"); @mysql_select_db("your database name"); $query = "SELECT all data from messages table"; $result = mysql_query($query); echo "The table, and the header row+columns"; while ($row = resulting row in array form) { echo "the row, and columns with data from the database in them"; } ?> </body> </html> Main script: <?php if (you have sent a POST variable, IE: the username and message fields in a HTML form) { mysql_connect("host", "user", "password"); @mysql_select_db("your database name"); $username = -check for anything that could be used for SQL injection or mess with the page-; $message = -check for anything that could be used for SQL injection or mess with the page-; $time = -get current time-; $query = "INSERT the username, password and time into your messages table"; mysql_query($query); } ?> <html> <head> <title>Your page title</title> </head> <body> <iframe src='./otherscript.php' width='100%' height='90%' /> <br /> form here to insert author and message with </body> </html> I think that just about concludes a basic layout of it. I've done more than I said I would, and given you some hints (using some keywords in there to Google with), but the rest is up to you. If you need help with something in particular, let us know.
-
And there lies the flaw. I've seen scripts get 'out of sync' with the real time after a little while.
-
1. Why can't you ask them for support? 2. You'll need: - a mySQL database (preferred) - a table to hold: -- message id [optional but preferred] -- author name -- message -- time [optional but preferred] - part of script to display output - part of script to handle database INSERTs. That is, the message going INTO the database. Its a very simple script overall, and I won't help you with full coding but with any usage snippets as you require. Good luck.
-
Of course it is. You're specifying to find *a string* + s. Its only logical that it will be returning Shiny's and Shadow's. Maybe you should tell us what your script is for exactly, so we can determine a better query.
-
Please remember to mark your topic as "Solved" with the button on your screen.
-
Thank you! No problem. If your problem is now solved, please click the "Solved" button.
-
You mean, to prevent proxy users from entering your site?
-
<?php $replace_to = $null; $sort = str_replace('%', $replace_to, $_GET['sort']); ?> Then just use $sort Change $replace_to as you please. Was only there to show you that you can change it. lol
-
What triggered it was exceeding the limit of queries your host has set. You can optimise your scripts to overall use less queries, but your only other options are upgrading with your host or finding one without a limit.
-
Javascript*
-
It means you've executed too many queries. I had a host that restricted queries, and its limit was 20000. I lasted for an hour before it went down due to exceeding the query limit. Edit: Forgot to mention, it should be back within an hour. The limit usually lasts an hour on most hosts. Talk to your host about it though.
-
Nice, I can see that should work. Why didn't I think of 24 hour time? *D'OH!* Also much smaller than mine.
-
Use the date() function. EG: <?php $day = date('l'); # Get day if ($day == "Saturday" || $day == "Sunday") # If its the weekend, deny access echo "No access on weekends, sorry!"; else # If its a weekday, continue processing { $ampm = date('a'); # Get am or pm $hour = date('h'); # Get current hour if ($ampm == 'am') # If its am, we want to go through and check the hours allowed in "am". { if ($hour >= 9 && $hour < 12) # If its after and including 9am, and before 12 am (as 12am is a totally different time), grant access { echo "You have access"; } else # Deny access echo "You do not have access at this particular time, sorry."; } else # If its pm, check the hours allowed for "pm". { if ($hour == 12 || $hour < 5) # If the hour is 12pm, or is below 5pm (up to 4.59pm), grant access { echo "You have access"; } else # Deny access echo "You do not have access at this particular time, sorry."; } } ?> That should work.. its rough, but it'll work I think.
-
In which case $group would need to be declared and defined prior to the define.