QuickOldCar
Staff Alumni-
Posts
2,972 -
Joined
-
Last visited
-
Days Won
28
Everything posted by QuickOldCar
-
How do you suggest to improve this download site
QuickOldCar replied to aditd's topic in Website Critique
I had no issue, but the text input was very tiny then and some like to see what they input. If have the space use it. While on the subject of the text box, should move it to the left and keep the download button to right, It's also harder to see a white input box on a white background. -
In your styles.css file you have #top_nav width set to 498px, which is most likely the size of your old image. I see that your new image is 648px width. Edit that and see if the nav image will fit, If not you will have to split your navigation into 2 with 2 images.
-
It doesn't seem like much a html editor. Even basic notepad has more features, I don't see the point in this if that's all it does.
-
For the GET requests, do checking on the input, only allow the types of input that is expected, otherwise, die,exit or redirect them elsewhere. Use mysql_real_escape_string() before the mysql query. Look at sanitize as well http://php.net/manual/en/filter.filters.sanitize.php
-
I'm sure others will say something similar to me. Unless you want to make an entire editor, the easiest is to use one that already exists. http://www.tinymce.com/ Can also look into bbcode. http://www.bbcode.org/
-
I don't see anywhere you close the table. </table>
-
You are correct, it is just commenting out the displaying of the tickets left. Everything else should function the same.
-
What I did was add the closing double quotes and semicolon to the last line being displayed. The commented line I made a new line with echo, now can just comment and uncomment it if need to. echo "<div class='venue'> <div class='match_date'><b>Match Date:</b> " . date(ymd, $v['m_date']) . "</div> <h2>" . escape($v['venue_name']) . "</h2> <div class='venue_address'>" . nl2br(escape($v['venue_address'])) . "</div> <div class='tickets_container'>"; //echo "<div class='tickets'>" . ($v['tickets_left'] < 30 ? "<span class='tickets_low'>" . escape($v['tickets_left']) . "</span>" : "" . escape($v['tickets_left']) . "") . " tickets left to buy for this match</div>";
-
Converting information seperated by commas in string into array?
QuickOldCar replied to pioneerx01's topic in PHP Coding Help
By using explode() <?php $_POST['ids']= "1000, 1001, 1002, 1003"; $array = explode(", ",$_POST['ids']); foreach($array as $value) { echo $value . "<br />"; } ?> results: 1000 1001 1002 1003 -
All you have to do is not display the areas that are showing how many tickets are left, this is the data coming from the database. Comment out this section like below, I think is what you are after. /* echo "<div class='venue'> <div class='match_date'><b>Match Date:</b> " . date(ymd, $v['m_date']) . "</div> <h2>" . escape($v['venue_name']) . "</h2> <div class='venue_address'>" . nl2br(escape($v['venue_address'])) . "</div> <div class='tickets_container'> <div class='tickets'>" . ($v['tickets_left'] < 30 ? "<span class='tickets_low'>" . escape($v['tickets_left']) . "</span>" : "" . escape($v['tickets_left']) . "") . " tickets left to buy for this match</div>"; */
-
Take a look at this script I wrote to embed multiple youtube videos from within a bunch of text. It will handle the shortened youtube.be urls. I have it fetch the video data from youtube's api also. Fullscreen works. http://www.phpfreaks.com/forums/index.php?topic=342974.msg1619535#msg1619535
-
You can use GD for multiple images in a loop on the fly if you link to a script using GD and the image source This way there will be no header issues. something like foreach($images_array as $image){ echo "<a href='$image'><img src='./GD-image-resize.php?image=$image' /> ": } I would save the resized image and cache it. Take a look at phpthumb. http://phpthumb.sourceforge.net/
-
I guess can do this way. Use glob() and find the image type files. Then file_put_contents() the location you want. Could even do a check if file_exists() new image, then unlink() the original image. That's providing you don't need it somewhere.
-
Maybe this would help you. <?php $file = 'dl.html'; // open the url and get content $url = file_get_contents('http://www.google.com'); //write the contents to the file file_put_contents($file, $url); //display the url contents //echo $url; //Display contents from the file include($file); ?>
-
Content Management Systems and URL Re-writing
QuickOldCar replied to Arty Ziff's topic in Miscellaneous
Yes it does matter more words in the url. In my search engine I look for keywords in both the url and also the title to obtain results, or advanced method to be more specific. To me it would make more sense to have the relevant word in the url,title and description if want to be seen more. Also to rank that link by weight of occurances and locations related to what searched for. Urls are gathered when a spider hits a webpage, then that url is usually visited by the crawler to gather more urls and also obtain the information of that visited url. They could easily have a priority system scraping urls that have higher ranked keywords first, but this is something a search engine might not want to reveal about their algorithm to website owners. Realize there are more types of bots out there than the standard search engine, some just collect urls, or urls and their titles and never visit the actual page for the rest of the information. Here's my thinking on it...if can do it easily then do it. If the url is just linking to simple categories,articles or pages, do the rewrites. It's a standard practice and what people expect to see. If your site has multiple type query parameters and they can also change, leave them be. (don't risk breaking something that works) Having no rewrite rules for url's doesn't seem to hamper youtube or phpfreaks for instance. But whatever you do, don't have duplicate type links on your site, ending with empty queries, a trailing slash and also no slash, the www and also no www, or have empty fragments. -
Content Management Systems and URL Re-writing
QuickOldCar replied to Arty Ziff's topic in Miscellaneous
Rewriting the urls makes it friendlier to view for users, and also helps the seo. If don't mind queries in your links it's fine, and ensures the link would always work. If were to rewrite them, just do it like so something like http://mysite.com/index.php?category=animals&species=cat&topic=cleaning to http://mysite.com/category/animals/species/cat/topic/cleaning If are linking to article id's or something similar with useless information to the user, it would be best to use fancy permalinks and titles http://mysite.com/article.php?id=548607 to http://mysite.com/article/how-to-clean-your-cat About search engines, having more words in the url helps, it won't matter if are characters or a slash seperating them, the words within are found the same. -
For a free hosting package can use this. Try the online demo's out. http://lxcenter.org/ If your question is about buying them domain names and finding them, create or find a whois script for checking registered domains, and then somewhere to purchase them. http://www.whoisscript.net/ In my experience it's best to rent them the space, and have tools for them to obtain domain names and purchase them not through you. We have entered a time that governments are taking domain names when that person does something wrong.
-
If your code used to work and you made no changes.....it's most likely the website is blocking you, or looking at how you look for content they could have easily just changed their style. Try a simple file_get_contents and see if can connect to that website or webpage, maybe they are blocking you now. You could try incorporating some error checking for empty values in your code.
-
Best advice I can give. http://php.net/manual/en/function.file.php http://php.net/manual/en/function.fread.php A simple example. <?php //read a file $my_file = "test.txt"; if (file_exists($my_file)) { $data = file($my_file); echo $data[0]."<br />".$data[2]."<br />"; } else { echo "No $my_file exists"; } ?>
-
My solution to dictionary attacks or trying to guess passwords is to just ban that ip on a certain amount of failed attempts. Fail2ban is a good solution. http://www.fail2ban.org/wiki/index.php/Main_Page
-
Just tried this code out and added an id and name to the database. I could see it fine, I made the text size from 2 to 10 or larger so I can actually see it. Added text input to the form also, made text red, be sure you have the required font in same directory <?php if(isset($_GET['player_name']) && $_GET['player_name'] !=''){ $username=""; $password=""; $database="characters"; $host="localhost"; $player_name=$_GET['player_name']; mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database. Be sure the databasename exists and online is."); $player_name = stripslashes($player_name); $player_name = mysql_real_escape_string($player_name); $query="SELECT * FROM characters WHERE name='$player_name'"; $result=mysql_query($query); $i=mysql_num_rows($result); if ($i == 1) { $name=mysql_result($result,0,"name"); $OnServer=mysql_result($result,0,"OnServer"); $hours=mysql_result($result,0,"hours"); header('Content-Type: image/png;'); $im = @imagecreatefrompng('1.png') or die("Cannot select the correct image. Please contact the webmaster."); $text_color = imagecolorallocate($im, 255,0,0); $text_username = "$name"; $text_hours = "$hours"; $text_online = "$OnServer"; $font = 'visitor2.ttf'; imagettftext($im, 10, 0, 39, 25, $text_color, $font, $text_username); imagettftext($im, 10, 0, 160, 25, $text_color, $font, $text_hours); imagettftext($im, 10, 0, 297, 25, $text_color, $font, $text_online); imagepng($im); imagedestroy($im); } else { echo('Username is not in our database. Please try again.'); } mysql_close(); } ?> <html> <head> <title>My title here</title> </head> <h1>Signature configuration.</h1> <p>Hello and welcome to the image configuration page.<br /> Before you can make your signature, we need in-game name, exact as it is.</p> <form action="" method="get"> Playername:<input type="text" size="35" maxlength="35" name="player_name"> <input type="Submit"> </form> </body> </html> Here's the code working using verdana font. http://get.blogdns.com/test/sig-image.php http://get.blogdns.com/test/sig-image.php?player_name=quick
-
Preg_replace thousands of arrays from table
QuickOldCar replied to surfwtw's topic in PHP Coding Help
I think you are making this hard on yourself. If you have the words in the database already, why are you trying to add all the href links to them in the database, that's a lot more information than you need to store. Just echo whatever result for word as a hyperlink on display. echo "<a href='definitiondisplay.php?word=$word'><b>$word</b></a>"; I believe if you write what the complete goal are trying to accomplish, is a better way to do it. -
preg_replace - I don't want it to be case sensitive
QuickOldCar replied to surfwtw's topic in PHP Coding Help
$find ="/$word/i"; //note the i for insensitive -
thumbnail-web-screenshots-script with php
QuickOldCar replied to dilbertone's topic in PHP Coding Help
I wrote some helpful information and links about this in the forum. http://www.phpfreaks.com/forums/index.php?topic=352033.msg1662293#msg1662293