-
Posts
14 -
Joined
-
Last visited
Never
About websiterepairguys
- Birthday 02/01/1965
Contact Methods
-
Website URL
http://www.webpit.com/
Profile Information
-
Gender
Male
websiterepairguys's Achievements

Newbie (1/5)
0
Reputation
-
Using PHP + GD to create a link map
websiterepairguys replied to websiterepairguys's topic in PHP Coding Help
I'm not a graphics artist. They are roughly in a circle. The blue boxes *are* the icons Gimp sucks. I found this too: http://www.maani.us/charts/index.php Thanks for your help -
Using PHP + GD to create a link map
websiterepairguys replied to websiterepairguys's topic in PHP Coding Help
Actually Come to think of it, i think this would make a damn fine Flash app for my project. Use flash/ajax to pull data from server as they click on the nodes, it repains the picture. This is a fictitious example. The project I'm working on is much more interesting then this example. Any flash gurus out here? [wrong board maybe but i'd be using PHP to feed the flash app so its not completely off topic ] -
Using PHP + GD to create a link map
websiterepairguys replied to websiterepairguys's topic in PHP Coding Help
Here is an example I just made in Gimp -
I'm not using the right terminology here, but what I am trying to do is create an image, say 1024x768, with an icon that represents a page in the middle. Then, it will have other icons that surround it in a circular fashion. These icons will be linked by a line indicating a relationship. If you've ever used frontpage to view the link map of a site you would know what I'm referring to. I'm at a disadvantage because of the math. Basically, I know I need to: calculate center point (easy) calculate radius (easy) draw circle (easy) calculate points along the circle's circumference (hard) draw icons centered on these points (medium) draw lines connecting points to center (easy) draw text midway between along this line indicating what the line represents (not so easy) Any help? Thanks
-
Referer can be faked. The best way to do this is to use a javascript submit function. inside the javascript set a hidden value, or a cookie, then check that value/cookie in your post routine. This will help reduce spam from robots. Mark
-
you dont need the quotes around $id here: <a href=\"delete_record.php?id='$id'\">Delete</a>
-
Keep in mind, this isn't a secure way of doing it. If the values in the array come from user entered input (in this example, hard to tell), you need to sanitize each value. That means looping through the array, and applying mysql_escape_string (or applicable db version) to each entry. I would create a function for doing this. Read up on SQL injection attacks. Regards, Mark
-
[code] //table background color = row_color variable......... echo "<td width=\"65\" valign=\"top\"><a href=\"#\">Edit</a></td><td width=\"65\" valign=\"top\"> [b]<a href=\"delete_record.php?keywords='$keywords'\">Delete</a></td></tr>";[/b] echo "</table></center>"; [/code] Your error is the link to delete. You should use urlencode to encode the keywords. <a href=\"delete_record.php?keywords=".urlencode($keywords)."\">Delete</a> But I would like to add that this is bad design. You should consider using primary keys (autonumber field in mysql) <a href=\"delete_record.php?id=$id\">Delete</a> Another problem. Your code is screaming SQL Injection attack. Google that phrase. I could delete all the records in your table with a simply change to the url for delete_record.php $keywords = $_GET['keywords']; // Delete a row from a table mysql_query("DELETE FROM dealer WHERE areacode = '$keywords'") or die(mysql_error()); $keywords variable needs to be escaped like this: $keywords = mysql_escape_string($_GET['keywords']); // Delete a row from a table mysql_query("DELETE FROM dealer WHERE areacode = '$keywords'") or die(mysql_error());
-
best practice for high traffic site
websiterepairguys replied to fotobleu's topic in Application Design
YIKES I would not put the HTML and the PHP in the same file. But thats just me. Check out http://smarty.php.net -
One more thing, If you are migrating a vb.net app to PHP you are going to have to create a lot of code (for whatever framework). CakePHP uses a 'code generator' type of thing. There is a tool on my website that I wrote called DBInspector. I wrote this a couple of years ago to generate base code for our sales app at the hosting company i worked at. The nice thing about this program is you can create your templates using various languages, and it will generate any kind of code, whether its data access classes, website templates, input forms, output code etc. I used it to generate all the smarty code for my app, as well as all the stored procedures for CRUD functions (we were using SQL Server). It also created the DAL (data access layer) for the app. http://www.websiterepairguys.com/tools/DBInspector-Code-Generation.html If you download it and need help contact me through the site. Regards, Mark
-
Really to subjective to answer. Better design? I'd say its less about design and more about utility. Go with what works. You're not painting a Picasso here Mark
-
So the question here is, are you coding your site for the remaining 89 percent, or the 11 percent that are unable to pass simple captchas? Here's what I would do (and this is my standard implementation): When the form is loaded, pull in the question / MD5 value of the answer from from a random list (admin edited). For multilingual sites, this can have a question for each language, etc.. Display the question via javascript document.write when the user enters the answer, compare the MD5 of his answer with the already known md5 of the correct answer. This a simple and effective captcha, even better then the images (which Im finding harder and harder to read). Take for example the captcha for this forum. It was incredibly small and doesn't take into account people with disabilities (with the exception of the listen function). Its funny, we put all this work into keeping bots out, and we can do nothing to keep some human from doing it manually. Regards, Mark
-
Fully Understanding MVC Concept?
websiterepairguys replied to Liquid Fire's topic in Application Design
Consider that there are two phases of access control: user authorization and authentication. First, user authentication, determines solely if the user is a user on the system. User authorization is typically a group based approach, where the user's membership to certain groups either provides, or restricts his abilities. In a small scale website, this might simply be used to determine if the user has access to a page, or area of the site. In more complex models, it would be used to determine if the user has Read, Write or Delete access to an object such as a page, or a calendar, or a calendar event. Some say this code should not be in the controller. It should be in a "business logic" class, so it could be used from multiple "clients" such as web, wap, API, Ajax, etc. However, an approach I recently took on my personal application (RocketCMS) was to integrate the controllers to the ajax server code so that I didnt need to create 'business logic' classes. Now, my controllers can serve two masters, AJAX and direct through the framework. MVC (or MVC+ as this is an extension of MVC) really is an ideal way to separate your application into tiers. I personally abhor applications that mix SQL, HTML, PHP all in one bowl of spaghetti. This is horrible coding and makes it very painful to work on any of those layers. Although an application might work fine, and is used by thousands or millions etc, it doesnt make it easy on the programmer to maintain or modify the code. Just my 2 cents. Mark