PHP - Can Anybody Give The Code For Review Approval Platform
i want the code for review approval platform (costumer reviews for a product )and in backend editing the code and updating it
Similar TutorialsThe following script comes from create a decorator example. Please take a look at __construct() and $pathItem. Doesn't look like any PHP I've ever seen. Agree? I don't think it matters and just stating so to make sure, but I am not using a docket but have api-platform on the local server. I've gotten all to work until now. <?php // api/src/OpenApi/JwtDecorator.php declare(strict_types=1); namespace App\OpenApi; use ApiPlatform\Core\OpenApi\Factory\OpenApiFactoryInterface; use ApiPlatform\Core\OpenApi\OpenApi; use ApiPlatform\Core\OpenApi\Model; final class JwtDecorator implements OpenApiFactoryInterface { public function __construct( private OpenApiFactoryInterface $decorated ) {} public function __invoke(array $context = []): OpenApi { $openApi = ($this->decorated)($context); $schemas = $openApi->getComponents()->getSchemas(); $schemas['Token'] = new ArrayObject([ 'type' => 'object', 'properties' => [ 'token' => [ 'type' => 'string', 'readOnly' => true, ], ], ]); $schemas['Credentials'] = new ArrayObject([ 'type' => 'object', 'properties' => [ 'email' => [ 'type' => 'string', 'example' => 'johndoe@example.com', ], 'password' => [ 'type' => 'string', 'example' => 'apassword', ], ], ]); $pathItem = new Model\PathItem( ref: 'JWT Token', post: new Model\Operation( operationId: 'postCredentialsItem', responses: [ '200' => [ 'description' => 'Get JWT token', 'content' => [ 'application/json' => [ 'schema' => [ '$ref' => '#/components/schemas/Token', ], ], ], ], ], summary: 'Get JWT token to login.', requestBody: new Model\RequestBody( description: 'Generate new JWT Token', content: new ArrayObject([ 'application/json' => [ 'schema' => [ '$ref' => '#/components/schemas/Credentials', ], ], ]), ), ), ); $openApi->getPaths()->addPath('/authentication_token', $pathItem); return $openApi; } } I am thinking that maybe the constructor needs to be changed to: private $decorated; public function __construct(OpenApiFactoryInterface $decorated) { $this->decorated = $decorated; } Regarding $pathItem, Model\PathItem's constructor is as follows. Any thoughts on what they are suggesting? Thanks public function __construct( string $ref = null, string $summary = null, string $description = null, Operation $get = null, Operation $put = null, Operation $post = null, Operation $delete = null, Operation $options = null, Operation $head = null, Operation $patch = null, Operation $trace = null, ?array $servers = null, array $parameters = [] ) {/* ... */}
Edited January 28 by NotionCommotion Not using docket This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=354376.0 if(get_images_for_delete($username, $newid, $mysqli) !== FALSE){ // WE are dealing with images $images = get_images_for_delete($username, $newid, $mysqli); $sourceBucket = "***********"; $targetBucket = "***********"; foreach($images as $image){ // copy our object $aws = new s3; $aws = $aws->copyObject($targetBucket, $image, $sourceBucket, $image); // delete our object $aws_delete = new s3; $aws_delete = $aws_delete->deleteObject($image); // copy our (thumbnail) object $aws2 = new s3; $aws2 = $aws2->copyObject($targetBucket, "thumb_".$image, $sourceBucket, "thumb_".$image); // delete our (thumbnail) object $aws_delete2 = new s3; $aws_delete2 = $aws_delete2->deleteObject("thumb_".$image); }Is my code. Do I need to declare so many new s3 classes? All the methods are within the same class. Not sure if this is the correct way to go about it. In a project that I'm working on I can specify routing rules, which is somewhat similar to mod_rewrite but in PHP. It's currently set up to use full regular expressions, but it's kind of overkill. I'm trying to convert it to use routing rules similar to some of the php frameworks I've seen. The code I've written up below is working, and while it's unlikely that I would need anything more complex, I'm wondering if anyone would like to comment, offer suggestions, or offer criticisms. This little piece of code is just a part of a bigger routing class, but this is the code that I'm concerned with. Thanks.
<?php $cfg['routes'] = [ 'cars/(:any)/(:any)/(:num).php' => 'cars/$3/$1/$2', 'default_route' => 'cars/index', 'trucks/parts?year=(:num)' => 'parts/trucks/$1', 'vans/articles(:any)' => 'articles$1' ]; $uris = [ 'cars/toyota/tercel/2014.php', # /cars/2014/toyota/tercel 'default_route', # /cars/index 'trucks/parts?year=2014', # /parts/trucks/2014 'vans/articles?p=42342' # /articles?p=42342 ]; $i = 0; foreach( $cfg['routes'] as $k => $v ) { $k = '|^' . preg_quote( $k ) . '$|uiD'; $k = str_replace( [ '\(\:any\)', '\(\:alnum\)', '\(\:num\)', '\(\:alpha\)', '\(\:segment\)' ], [ '(.+)', '([[:alnum:]]+)', '([[:digit:]]+)', '([[:alpha:]]+)', '([^/]*)' ], $k ); echo '<br />' . $uris[$i] . '<br />' . $k . '<br />'; if( @preg_match( $k, $uris[$i] ) ) { echo preg_replace( $k, $v, $uris[$i] ) . '<br /><br />'; } $i++; } I have a problem with the below code: Code: [Select] <?php $sql_ranks = ("SELECT vtp_members.id, vtp_members.name, vtp_members.teamleader, teams.team_name, count(vtp_tracking.id) surfs FROM vtp_members, vtp_tracking, teams WHERE vtp_members.team_id=".$_GET['t']." AND vtp_tracking.credit_members_id=vtp_members.id AND vtp_tracking.action_date > '$last_sunday' AND vtp_tracking.action_date < '$next_sunday' GROUP BY teams.team_name ORDER BY surfs DESC"); $rsranks = mysql_query($sql_ranks); echo "<br><table align='center' valign='top' border='0' width='300px'> <tr><td colspan='2' align='center'><font size='2px'><b>Team Rankings (Current Week)</b></font></td></tr> <tr><td><font size='2px'><b>Team</font></td><td align='right'><font size='2px'>Total Surfs</font></td></tr>"; while ($row = mysql_fetch_array($rsranks)) { echo "<tr><td><font size='2px'><b>".$row[team_name]."</font></td><td align='right'><font size='2px'>".$row[surfs]."</font></td></tr>";} echo "</table>"; ?> Problem is that the last output (".$row[surfs].") is the same for all teams. It seems it is not making a total of all id's and not per team_name. anyone can see what I am doing wrong. I need to sort by team_name and the surfs should display the total of the members with team_id is ".$_GET['t']." $username = $loggedInUser->username; // This is the logged in username $time = time(); $makedir = $username.'_'.$time; $var = getcwd(); $var = str_replace('\users', '\imageuploads', $var); $dirlocation = $var."\\".test_directory($username, $mysqli); function test_directory ($username, $mysqli) { $stmt = $mysqli->prepare("SELECT Temp_Directory FROM uc_users WHERE user_name LIKE ?"); $stmt->bind_param("s", $username); $stmt->execute(); $stmt->bind_result($Tempdir); while ($stmt->fetch()){ return $Tempdir; } } if((!empty(test_directory($username, $mysqli))) && is_dir($dirlocation)){ //echo "this is it"; $thedirectory = $dirlocation; } if(empty(test_directory($username, $mysqli))){ //echo "it's not a directory"; $newdir = $var."\\".$makedir; $query = mysqli_query($mysqli, "UPDATE uc_users SET Temp_Directory='$makedir' WHERE user_name='$username'"); if(!$query){ //echo mysqli_error($mysqli); } mkdir($newdir); //security chmod($newdir, 0644); $thedirectory = $newdir; } if(!is_dir($dirlocation) && (!empty(test_directory($username, $mysqli)))){ //echo "third one"; mkdir($dirlocation); chmod($dirlocation, 0644); $thedirectory = $dirlocation; } Ok, so what I'm doing here is testing to see whether a a record exists of the user having a folder in the MySQL database. Then, if it does, make sure that a folder exists at that location. If there is no folder, we create one for the user. If there is already a folder, we leave it alone. This is for image uploads, and $thedirectory, is where we upload images later on in the script. Hope that makes sense. The code seems to work. But how can I improve it and make it more robust? Or should I just leave it alone? Should I return FALSE from the function for better reliability over empty()? Alright, this is the code that i cant seem to get working. Its supposed to update the pin_lock field in my database. I have two databases that it needs to read from, the Account database to verify the login, then the Game database to modify the pin_lock field. It comes up that its sucessfully modified the entry but when i check it, its still the same as it was before. session_start(); if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') { print("<center>Incorrect verification code!"); die(); } require_once('config.php'); mysql_select_db($accdb); $accountid=$_POST['accountid']; $pass=$_POST['pass']; $email=$_POST["email"]; $idnumber=$_POST["question"]; $phone=$_POST["answer"]; session_start(); if(!$_POST["accountid"]) { print("<center>Account ID Field Empty!"); die(); } if(!$_POST["email"]) { print("<center>E-mail Address Field Empty!"); die(); } if(!$_POST["question"]) { print("<center>Security Questions Field Empty!"); die(); } if(!$_POST["answer"]) { print("<center>Answer Field Empty!"); die(); } if(!ereg("^[0-9a-z]{4,12}$",$accountid)) { print("<center>Account ID Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 12 characters"); die(); } if(!ereg("^[0-9a-z]{4,14}$",$pass)) { print("<center>Password Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 14 characters"); die(); } if(!ereg("^[0-9a-zA-Z_]{4,128}$", (strtr($email, Array('@'=>'','.'=>''))))) { print("<center>E-mail Only letters a to z and special chars @ . are allowed!"); die(); } if($_POST["pass"]!=$_POST["pass2"]) { print("<center>Passwords do not match!"); die(); } $ac = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid'"))); if (!$ac) { print("<center>Account ID does not exist!"); die(); } $em = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND email='$email'"))); if (!$em) { print("<center>E-mail is incorrect!"); die(); } $q = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND idnumber='$idnumber'"))); if (!$q) { print("<center>Security Question is incorrect!"); die(); } $an = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid' AND phone='$phone'"))); if (!$an) { print("<center>Answer is incorrect!"); die(); } $ac = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM account WHERE name='$accountid'"))); mysql_select_db($gamedb); $temp["query"] = sprintf("UPDATE cq_user SET lock_key='0' WHERE account_id='$selectedid'"); if (!mysql_query($temp["query"])) { die(mysql_error()); } else { print("<center>You bank pin has been removed!"); } Any ideas what is wrong with it? hi I have one problem with this script. I want that he the videos when status = active but i don'T know how i should write this in the $where. I mean take video WHERE status = ACTIVE. Maybe someone can help me, it's will be great! Thanks a lot ;-) Hier is the script: static function count($table, $where = '', $order = '', $limit = '', $group = '') { $sql = 'SELECT COUNT(*) '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::result($sql); } static function field($table, $field, $where = '', $order = '', $limit = '', $group = '') { $sql = 'SELECT `' . $field . '` '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::column($sql); } static function select($table, $where = '', $order = '', $limit = '', $fields = '*', $group = '') { $sql = 'SELECT ' . (is_array($fields) ? '`' . implode('`,`', $fields) . '`' : $fields) . ' '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::all($sql); } This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313317.0 About the project.
We are looking to build a Car Dealer Platform (CMS) to be able to offer it as a “Software as a Service” to range of our clients. What we would like to achieve is something similar to what is currently available on the market. I did a little research and the are a lot of scripts, plugins, software and such already available online (i.e. http://www.hotscripts.com/category/scripts/php/scripts-programs/classified-ads/autos/, http://www.worksforweb.com/classifieds-software/iAuto/, http://intersofts.com/) however, we require some functionality that are not included in the above mentioned and we want this to be a bespoke platform tailored for us.
The platform must have:
ability to accommodate Comcar data (http://comcar.co.uk/)
ability to accommodate Cap data (http://www.cap.co.uk/)
ability to accommodate finance calculator (i.e. https://ivendi.com/)
ability to accept stock feeds from Dealership Management System (i.e. http://www.2ndbyte.com/)
ability to send used car stock feed to used car portals such as AutoTrader (http://www.autotrader.co.uk/), Motors (http://www.motors.co.uk/), AA Cars (http://www.vcars.co.uk/)
full registration lookup on used car stock through a Vehicle Registration Mark (http://business.cap.co.uk/products-and-services/vrm-look)
Service and MOT booking to include registration lookup
easily add multi locations and assign stock for each location
capture leads via contact forms
of course must be responsive, SEO friendly and compliant with the latest web standards
easy to add new pages, locations, franchise
easy to upload the offer banners for the home page
easy to customize for each client / dealer (CSS, HTML, JS)
I am fully aware this is not a small project and it will take a lot of time and manpower to accomplish this, however I am positive about it. This would be developed in stages so we could start offering it to our clients with ideally long time support from the creators of the platform.
Here are some examples of platforms currently available on the market and few websites created based on these platforms:
NetDirector - http://www.gforces.co.uk/
http://www.hrowen.co.uk/
http://www.thurlownunn.co.uk/
http://www.deswinks.com/
http://www.glynhopkin.com/
http://www.trustford.co.uk/
http://www.westlandsmotorgroup.co.uk/ (as two franchises and uses latest version of platform)
Web21st - http://www.web21st.com/
http://www.wjking.co.uk/
http://www.sussexusedcars.uk.com/
http://www.wilsonandco.com/
http://www.findvauxhall.co.uk/
Bluesky Interactive - http://www.blueskyinteractive.co.uk/ - Cognition CMS based (http://www.blueskyinteractive.co.uk/admin/)
http://www.fish-bros.co.uk/
http://www.nowvauxhall.co.uk/
http://www.alandayvw.co.uk/
http://dinnages.co.uk/
http://griffinmill.co.uk/
Denison Automotive - http://www.denison.co.uk/automotive/
http://www.perrys.co.uk/
http://www.trusteddealers.co.uk/
http://www.westwaynissan.co.uk/
http://www.tilsungroup.com/
Please feel free to PM me anything related to the topic and ask questions if something is unclear as well as if you require more info.
What I am hoping to achieve by posting this here is to get some advice from experienced / senior php developers to point us in the right direction and hopefully to start a partnership.
We are based in North London.
Thank you.
Alek
Any pointers would be much appreciated. I got my PHP app working (not without some great help from this forum) but when I migrated my PHP scripts and MySQL database to my ISP's platform the app fell apart since the web is the destination for this app, I then had to diagnose and fix what happened. The problem: On the ISP's platform, a query string passed unescaped with say a QUOTE in it came in on the subsequent GET ESCAPED. On my platform they arrived UNESCAPED. Is this a php.ini discrepancy or a version discrepancy between us please? Thing is I'd like to get the local version working again after all the changes because what worked on one broke on the other, now the other is fixed the one is broken if you get my drift. Platform / Version variations: Local implementation is Win7, Apache 2.2.19 / PHP 5.3.6 / MySQL 5.5 ISP is Linux not sure of the Apache version believe it is 2.? PHP 5.2.14 / MySQL Client Api 4.1.22 Any input or links for reading would be appreciated. Jamie I've develped this small script to display user reviews stored in a my databases review table. The problem with the script though is that it seems to be looping ad nauseum. The wierd thing though, is that I've used a very similair script to display another list of items on this site, and it worked correctly without any issue. Could someone take a look at this for me and diagnose the error with the script. The SQL table: Code: [Select] CREATE TABLE IF NOT EXISTS `rev` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rev_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `usr_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `text` varchar(600) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; The PHP script: Code: [Select] User reviews for <? echo $member;?> <br> <table border="0"> <?php for($count = 1; $count <= $revrows; $count++) { $sqlrev = "SELECT * FROM rev WHERE rev_name = '$member' ORDER BY id DESC"; $revresult = mysql_query($sqlrev) or die(mysql_error()); $revrows = mysql_fetch_row($revresult); $revname = mysql_fetch_array($revresult); ?> <tr> <?php print "Review by: " . $revname['usr_name'] . "<br>". $revname['text']; ?> </tr> <?php } ?> </table> Heya folks, I came here in hope someone could shed some light on the situation I'm in, it's probably looking me straight in the face and I cant see it.. So basically, I've got my page sorted, I'll theme it for my website later, but it echo's out entry's from a SQL database (images to be reviewed) then it has the name, id and accept and reject buttons. Currently I have the page echoing perfectly, the reject button removes from SQL but does not delete the actual image (that's where I need help) The accept button currently has no function as I've tried INSERT INTO but I cant get it working, so here's some code I hope someone knows what's missing Page that echo's from SQL; Code: [Select] <?php $dbHost = "xxxxxxx"; $dbUser = "xxxxxxx"; $dbPass = "xxxxxxx"; $dbName = "xxxxxxxx"; $db = mysql_connect($dbHost,$dbUser,$dbPass); mysql_select_db($dbName,$db); $image_name='fullsize' ?> <?php $result = mysql_query("SELECT id, fullsize FROM tblimages"); $filename['fullsize'] ?> <html> <table> <tr> <td>Image Uploads</td> </tr> <?php while($row = mysql_fetch_array($result)) : $image = $row['fullsize'] ?> <tr> <td><?php echo $row['id']; ?></td> <td><?php echo $row['fullsize']; ?></td> <td><?php echo '<img src= "uploads/'.$row['fullsize'].'" width="180" height="180"/> '; ?> </td> <!-- and so on --> <td> <form action="delete.php" method="post"> <input type="hidden" name="delete_id" value="<?php echo $row['id']; ?>" /> <input type="submit" value="Reject" /> </form> <form action="insert.php" method="post"> <input type="hidden" name="insert_id" value="<?php echo $row['filename']; ?>" /> <input type="submit" value="Accept" /> </form> </td> </tr> <?php endwhile; ?> </table> </html> The delete.php's code is; Code: [Select] <?php if(isset($_POST['delete_id']) && !empty ($_POST['delete_id'])) { $delete_id = mysql_real_escape_string($_POST['delete_id']); mysql_query("DELETE FROM tblimages WHERE `id`=".$delete_id); header('Location: test.php'); } ?> And my insert.php is currently faulty code, so but I used virtually the same as the delete.php but where 'delete_id' is I replaced with 'insert_id' My database is laid out like this, tblimages (this is where images that need to be reviewed are stored) [id, fullsize] <- columns stored inside images (this is where images that have been accepted should be moved to) [filename] <-where images should be inserted to. Hope someone can understand and help with this, if so, thank you very much ^_^ why is it that when i try to submit it tells me add a picture but i did added Code: [Select] <?php //decarling some variables $msg = ""; //begin if if($_POST['submitbtn']){ $author = mysql_real_escape_string($_POST['author']); $date = mysql_real_escape_string($_POST['date']); $picture = $_FILES['picture']['name']; $ext = strtolower(substr($name,strpos($name,'.')+1)); $size = $_FILES['picture']['size']; $maxsize = 200000; $type = $_FILES['picture']['type']; $tmp = $_FILES['picture']['tmp_name']; $review = mysql_real_escape_string($_POST['review']); $move = "uploads/"; if(isset($author) && !empty($author)){ if(isset($date) && !empty($date)){ if(isset($picture) && !empty($picture)){ if($size <= $maxsize){ if($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png'){ if(move_uploaded_file($tmp,$move.$name)){ if(isset($review) && !empty($review)){ $query = mysql_query(" INSERT INTO reviews ('',author,date,picture,review) VALUES ('',$author,$date,$picture,$review)"); }else $msg = "Please write a review"; }else $msg = "Error has happen try again later"; }else $msg = "Image must be a jpg, jpeg, or png"; }else $msg = "You must select a smaller image size"; }else $msg = "Select a picture"; }else $msg = "Please enter a date"; }else $msg = "Please fill in the Authors name"; } //ending the if here ?> I've been maintaining my old site http://www.tomsfreelance.com even though it's kind of just a business card at this point. So I decided to implement some javascript stuff I had been working on for other reasons. So far it seems to I have some work to do in Firefox, but I think it's working pretty well otherwise.
This is a bit of an oddball of a site and just about 99% javascript.
Feedback is much appreciated!
So I was working on this site past month. I know it is too much time for such simple website, but I am a perfectionist and I need to have everything perfect. It is using JQuery, Twitter Bootstrap (I am deep fan of TWBS and I am using it on almost every website I make) and Yeti(?probably, I forgot ) theme from Bootswatch. Of course also FontAwesome for YT, FB, Twitter an GitHub icons. On smaller resolutions it is looking epic (1024x768 etc etc), on mobile devices too, but I am not sure how it looks on HD, HD-ready resolutions (yes, I can use zoom-out in my browser, but it is misleading...). What do you think?
P.S.: Projects in "My Recent Work" are clickable and that will toggle description with some fancy fade effect (using jQuery.toggle()).
P.S.2: I am not sure if I should vertically-center contact text or let it be with big top and bottom padding. What do you think?
P.S.3: Oh, I almost forgot. Website link is here http://deathbeam.github.io/. Yes, I am using GitHub pages, I love git. And nope, I do not bought my own domain yet.
P.S.4: I accept "brutal" criticizm, feel free to be rude
P.S.5: (this is starting to be annoying lol): If you guys have time, can you please tell me what feeling do you have from my subsite http://deathbeam.git...fwphp/index.htm. I tried to keep everything as simple as possible, but I am not sure if it is not too much :/
P.S.6: I am really sorry for my English...
Edited by deathbeam, 08 September 2014 - 01:08 PM. I have spent a little time lately developing a database class (not finished yet) that automatically will escape the data that is sent to it if used properly. I would like to get some input on it and see what some of you guys think of it. Mainly I would like to know if it is easy to use, if there is any potential issues so far, and if there are any suggestions on better ways to do things in the class. I have attached a copy of the class to this post. Here is an example of how to use it: Code: [Select] //create object $db = new db(); //perform query $users = $db->table('users')->select('*')->where("name='%s'")->vars("somename")->getResults(); //another way to perform the query above $db->table('users')->select('*')->where("name='%s'")->vars(array("somename")); $users = $db->getResults(); You will have to change the db connection properties at the top of the db.class.php file for your own connections. Please let me know of any suggestions, questions or issues that you have. Hello guys,
I am an intermediate level PHP programmer and digging my way through this giant universe of programming,
During this term, I have been able to build logics for problems (simple ones though) using my own thinking etc etc..
Anyway, I fully understand that I still have a lot to learn and I dont have any teachers to guide me through. So I wanted to request that If i submit an application for a quick review, like what I missed, how should I do it next time and guidance like this will seriously help me through.
I know it will be a pain reviewing someone else's apps but i dont have elsewhere to go..
Hello all. I'm a newbie to this site and PHP and trying to build a basic contact/info form for an insurance company. I've been testing what I've done in FF, IE, and Google Chrome, and it seems to be generating consistent results ... but I thought I'd run it past the EXPERTS here, so you can tell me all that I've done wrong. : ) Attached is the PHP page that is triggered by a basic HTML page with check boxes, etc. And below is what a resulting email looks like, which is fine by me (of course this is empty). Thanks for any advice! -RP ------------------------------------------------- Name: Tel: Company: State: Website: Employees: ===== Type of Business ===== Manufacturer: Retailer: Jobber/Restyler: Distributor: Motorsports: Professional Services: ===== Insurance Needs ===== General Liability: Garage/Keepers: Property Building: Property Equipment: Loss of Income: Worker's Comp.: Internet Liability: Life & Disability: Product Liability: Legal Liability: Property Contents: Cargo/Mobile Property: Employee Dishonesty: 401K & Retirement: Health: Other: Personal Comments: ========================= hello dear community i try to find a way to use file_get_contents: a download of set of pages: Can any body review my approach .. and as i thought i can find all 790 resultpages within a certain range between Id= 0 and Id= 100000 i thought, that i can go the way with a loop: http://www.foundationfinder.ch/ShowDetails.php?Id=11233&InterfaceLanguage=&Type=Html http://www.foundationfinder.ch/ShowDetails.php?Id=927&InterfaceLanguage=1&Type=Html http://www.foundationfinder.ch/ShowDetails.php?Id=949&InterfaceLanguage=1&Type=Html http://www.foundationfinder.ch/ShowDetails.php?Id=20011&InterfaceLanguage=1&Type=Html http://www.foundationfinder.ch/ShowDetails.php?Id=10579&InterfaceLanguage=1&Type=Html How to mechanize with a loop from 0 to 10000 and throw out 404 responses once you reach the page we then could use beautifulsoup to get the content (in our case the image file address) but we also could just loop trough the images directely with simple webrequests. Well - how to proceed: like this: <?php // creating a stream! $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" ) ); // opens a file $file = file_get_contents('http://www.example.com/', false, $context); ?> a typical page is http://www.foundationfinder.ch/ShowDetails.php?Id=134&InterfaceLanguage=&Type=Html and the related image is at http://www.foundationfinder.ch/ShowDetails.php?Id=134&InterfaceLanguage=&Type=Image after downloading the images we will need to OCR them to extract any useful info, so at some stage we need to look at OCR libs. I think google opensourced one, and since its google it has a good chance it has a python API can anybody review the approach - look forward to hear from you |