PHP - Review My Portfolio Site Please ;)
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. Similar TutorialsI'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!
I would like to create a portfolio for future reference and for potential employers. What's the best way to do this? Should I make individual pages with examples of different code or create a website which functions to demonstrate the code? Thanks I had an interesting idea, but I don't know if it exsisted... Say for example if I had designed the CNN homepage, that clearly gets updated every few minutes with new news, if I wanted to show this in my portfolio as as example of a project I have designed, is there a way of creating a thumbnail or image of the site, which would be updated in real time to go along side the description? (I say real time, but I guess I mean every couple of hours or so) If anyone has seen anything like this or has any suggestions, let me know what you think! This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=345741.0 Hi guys I am busy with a website for myself and need some help on this, because I am stuck and not getting this right.
Can someone tell me where is a tutorial or where I can find a code to help me with this , I have attached a pictures on what I need and want. the second image is what need to happen when someone click on the image in the Portfolio
Below Is the html code for this Portfolio Gallery but need it to be like in a database where I can upload or add new work.
<!-- PORTFOLIO --> <div class="row portfolio-page"> <div class="hide" id="project-info"> <div id="content"> <i class="fa-times fa back"></i> <div class="row"> <div class="large-11 columns"> <h2 class="project-title">Super Design</h2> </div> <div class="large-6 columns"> <div class="project-images"> <div class="item-list"> <ul class=""> <li> <a href="#"> <img width="500" height="380" alt="13tndZF" class="attachment-project-thumb" src="assets/images/12.jpg"> </a> </li> </ul> </div> </div> </div> <div class="large-6 columns project-content"> <p>Donec pulvinar porttitor felis ac tincidunt. Quisque sit amet ligula quis lacus pellentesque luctus consequat aliquam neque. Nunc ac elit eu odio consequat rutrum. Suspendisse nec facilisis turpis. </p> <p>Proin egestas nisl in nibh condimentum, nec ornare erat egestas. Fusce dui est, gravida ut sem vitae, tincidunt pharetra massa. In erat libero, fermentum suscipit pretium vel, eleifend vitae odio. Nullam quis mi velit. Cras ut aliquet orci.</p> <p>Curabitur sollicitudin massa quis magna cursus, a auctor dolor imperdiet. Nullam ultrices pretium mauris, vel fermentum nisl venenatis ac. Aenean adipiscing lorem a purus viverra, eu</p> </div> </div> </div> </div> <ul class="small-block-grid-1 large-block-grid-3"> <li class="article portfolio-item" id="160"> <figure> <img width="500" height="380" src="assets/images/12.jpg" alt="13tndZF" /> <figcaption class="text-center"> <h3>Super Design</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="157"> <figure> <img width="500" height="380" src="assets/images/13.jpg" alt="1j5JfNg" /> <figcaption class="text-center"> <h3>Cool Project</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="153"> <figure> <img width="500" height="380" src="assets/images/14.jpg" alt="1m7ZhI3" /> <figcaption class="text-center"> <h3>New Project</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="94"> <figure> <img width="500" height="380" src="assets/images/15.jpg" alt="1a2n0Ck" /> <figcaption class="text-center"> <h3>Sed porttitor</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="79"> <figure> <img width="500" height="380" src="assets/images/16.jpg" alt="7714491824_ef36a096ff_b" /> <figcaption class="text-center"> <h3>Kid Play</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="73"> <figure> <img width="500" height="380" src="assets/images/17.jpg" alt="8364043731_9da828b5c7_h" /> <figcaption class="text-center"> <h3>Project Two</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="71"> <figure> <img width="500" height="380" src="assets/images/18.jpg" alt="almond-blossom-5378_1280" /> <figcaption class="text-center"> <h3>Project One</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="96"> <figure> <img width="500" height="380" src="assets/images/19.jpg" alt="Youthful learners" /> <figcaption class="text-center"> <h3>Etiam at commodo</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> <li class="article portfolio-item" id="14"> <figure> <img width="500" height="380" src="assets/images/20.jpg" alt="9862145525_c08b245398_h" /> <figcaption class="text-center"> <h3>Project 1</h3> </figcaption> </figure> <span class="plus-icon flipOutX"><i class="fa-plus fa"></i></span> </li> </ul> </div> <!-- END PORTFOLIO/> --> </div> </section> I am trying to find a job doing PHP and MySQL. I have a portfolio section where I created a really simple Postcard application where visitors can send people they know online postcards via email after they click on confirmation link i send them using sha1() as token in a temp table that holds information. I was also going to add a section where I show usage of Regular Expressions and things. Does anybody have any suggestions what other web apps or whatever I could add to this section to make my portfolio section really POP to potential employers? Any suggestions are welcome and much appreciated. Hi, I've attempted to put together a portfolio on my WP blog using php, jquery, and this tutorial- http://wp.tutsplus.com/tutorials/theme-development/create-a-quicksand-portfolio-with-wordpress/ I've gone to my WP site and tried to put it together, but nothing seems to work. Aside from "what's wrong?" I'd also like to know how do I utilize these features to display my portfolio? (Simply post images in the page/post, set featured images, etc.) My apologies for this perhaps not being the easiest question, but thorough help and advice is greatly appreciated. If further information is needed, please let me know. functions.php <?php // portfolio include("portfolio/portfolio-post-types.php"); // Register our scripts function register_js() { if ( !is_admin() ) { wp_register_script( 'quicksand', get_template_directory_uri() . '/js/jquery.quicksand.js', 'jquery' ); wp_register_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', 'jquery' ); wp_register_script( 'custom', get_template_directory_uri() . '/js/jquery.custom.js', 'jquery', '1.0', true ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'quicksand' ); wp_enqueue_script( 'easing' ); wp_enqueue_script( 'custom' ); } } add_action('init', 'register_js'); // Register our styles function register_css() { if (!is_admin()) { wp_register_style( 'prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css' ); wp_enqueue_style( 'prettyPhoto' ); } } add_action( 'init', 'register_css' ); // sidebar functions if(function_exists('register_sidebar')) { register_sidebar(); } // add thumbnail support add_theme_support('post-thumbnails'); // disable autoformat with raw function my_formatter($content) { $new_content = ''; $pattern_full = '{(\[raw\].*?\[/raw\])}is'; $pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { $new_content .= wptexturize(wpautop($piece)); } } return $new_content; } remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wptexturize'); add_filter('the_content', 'my_formatter', 99); ?> portfolio.php <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> <!-- #content BEGIN --> <div id="content" class="clearfix"> <ul class="filterable-grid clearfix"> <?php $wpbp = new WP_Query(array( 'post_type' => 'portfolio', 'posts_per_page' =>'-1' ) ); ?> <?php if ($wpbp->have_posts()) : while ($wpbp->have_posts()) : $wpbp->the_post(); ?> <?php $terms = get_the_terms( get_the_ID(), 'filter' ); ?> <li data-id="id-<?php echo $count; ?>" data-type="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>"> <?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : ?> <?php the_post_thumbnail('portfolio'); ?> <?php endif; ?> <p><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></p> </li> <?php $count++; ?> <?php endwhile; endif; ?> <?php $large_image = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' ); $large_image = $large_image[0]; ?> <?php wp_reset_query(); ?> </ul> </div><!-- #content END --> <?php get_sidebar(); ?> <?php get_footer(); ?> portfolio-post-types.php <?php // function: post_type BEGIN function post_type() { $labels = array( 'name' => __( 'Portfolio'), 'singular_name' => __('Portfolio'), 'rewrite' => array( 'slug' => __( 'portfolio' ) ), 'add_new' => _x('Add Item', 'portfolio'), 'edit_item' => __('Edit Portfolio Item'), 'new_item' => __('New Portfolio Item'), 'view_item' => __('View Portfolio'), 'search_items' => __('Search Portfolio'), 'not_found' => __('No Portfolio Items Found'), 'not_found_in_trash' => __('No Portfolio Items Found In Trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'supports' => array( 'title', 'editor', 'thumbnail' ) ); register_post_type(__( 'portfolio' ), $args); } // function: post_type END // function: portfolio_messages BEGIN function portfolio_messages($messages) { $messages[__( 'portfolio' )] = array( 0 => '', 1 => sprintf(('Portfolio Updated. <a href="%s">View portfolio</a>'), esc_url(get_permalink($post_ID))), 2 => __('Custom Field Updated.'), 3 => __('Custom Field Deleted.'), 4 => __('Portfolio Updated.'), 5 => isset($_GET['revision']) ? sprintf( __('Portfolio Restored To Revision From %s'), wp_post_revision_title((int)$_GET['revision'], false)) : false, 6 => sprintf(__('Portfolio Published. <a href="%s">View Portfolio</a>'), esc_url(get_permalink($post_ID))), 7 => __('Portfolio Saved.'), 8 => sprintf(__('Portfolio Submitted. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url( add_query_arg('preview', 'true', get_permalink($post_ID)))), 9 => sprintf(__('Portfolio Scheduled For: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview Portfolio</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime($post->post_date)), esc_url(get_permalink($post_ID))), 10 => sprintf(__('Portfolio Draft Updated. <a target="_blank" href="%s">Preview Portfolio</a>'), esc_url( add_query_arg('preview', 'true', get_permalink($post_ID)))), ); return $messages; } // function: portfolio_messages END // function: portfolio_filter BEGIN function portfolio_filter() { register_taxonomy( __( "filter" ), array(__( "portfolio" )), array( "hierarchical" => true, "label" => __( "Filter" ), "singular_label" => __( "Filter" ), "rewrite" => array( 'slug' => 'filter', 'hierarchical' => true ) ) ); } // function: portfolio_filter END add_action( 'init', 'post_type' ); add_action( 'init', 'portfolio_filter', 0 ); add_filter( 'post_updated_messages', 'portfolio_messages' ); jquery.custom.js Code: [Select] function portfolio_quicksand() { // Setting up our variables var $filter; var $container; var $containerClone; var $filterLink; var $filteredItems // Set our filter $filter = $('.filter li.active a').attr('class'); // Set our filter link $filterLink = $('.filter li a'); // Set our container $container = $('ul.filterable-grid'); // Clone our container $containerClone = $container.clone(); // Apply our Quicksand to work on a click function // for each of the filter li link elements $filterLink.click(function(e) { // Remove the active class $('.filter li').removeClass('active'); // Split each of the filter elements and override our filter $filter = $(this).attr('class').split(' '); // Apply the 'active' class to the clicked link $(this).parent().addClass('active'); // If 'all' is selected, display all elements // else output all items referenced by the data-type if ($filter == 'all') { $filteredItems = $containerClone.find('li'); } else { $filteredItems = $containerClone.find('li[data-type~=' + $filter + ']'); } // Finally call the Quicksand function $container.quicksand($filteredItems, { // The duration for the animation duration: 750, // The easing effect when animating easing: 'easeInOutCirc', // Height adjustment set to dynamic adjustHeight: 'dynamic' }); }); $container.quicksand($filteredItems, function () { lightbox(); } ); } function lightbox() { jQuery("a[rel^='prettyPhoto']").prettyPhoto({ animationSpeed:'fast', slideshow:5000, theme:'pp_default', show_title:false, overlay_gallery: false, social_tools: false }); } if(jQuery().prettyPhoto) { lightbox(); } This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319419.0 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 ^_^ 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> 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 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. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=354376.0 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 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: ========================= Dear Friends. Just now I tried to create PHP to make Rest API for my mobile application and I would like to know that it's good coding and need any improve? it is my first time for Rest API. normally I just connect to PHP file directly on .htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([0-9A-Za-z_]+)$ function.php?func=$1 [L,QSA] RewriteRule ^([0-9A-Za-z_]+)/$ function.php?func=$1 [L,QSA] on function.php $func = $_GET['func']; switch( $func) { case 'lab_info': //ໜ້າຫຼັກ define( '_FUNC', 'lab_info.php'); break; case 'customer_info': //ຂໍ້ມູນຜູ້ໃຊ້ define( '_FUNC', 'customer_info.php'); break; default: // No function define( '_FUNC', 'functionnotfound.php'); break; } if( defined( '_FUNC') && constant( '_FUNC') !='') require( "func/" . _FUNC); on customer_info.php $error = array(); if(isset($_POST['user']) != 'lung'){ $error['status'] = "422"; $error['title'] = "Authentication Fail"; $error['detail'] = "Invalid user authentication"; echo json_encode($error);die(); } if(!isset($_POST['user'])){ $error['status'] = "401"; $error['title'] = "Invalid Attribute"; $error['detail'] = "Invalid Attribute For Information"; echo json_encode($error);die(); } $result = $conn->query("select Lab_Name,Lab_Username,Lab_Password from tb_labmanagers"); $customer = array(); while($row =mysqli_fetch_assoc($result)) { $customer[] = $row; } echo json_encode($customer); this image attached file is result from postman, client need to send user = 'lung' to get information
i want the code for review approval platform (costumer reviews for a product )and in backend editing the code and updating it Hello,
I'm the sole developer of Aptugo (http://www.aptugo.com), a web RAD development environment with focus on making every developer's life easier. I've spent countless hours over the last two years developing it, and while the main focus is to be a CRUD boilerplate, it can actually build complete websites with great features (Aptugo's website was completely built with Aptugo, and google page insights gave me a score of 92 right out of the oven and without any effort).
Anyway, it would be really nice if you could spend a few minutes taking a look at Aptugo, It is free, and I really want to keep it free forever, in order to be able to achieve that, I really mouth-to-mouth promotion, so I'm not trying to sell you anything here, I'm just asking for help and your empathy! . If you could tell me: "I would use aptugo if it..." I would really appreciate it.
Have a great day,
Gaston
|