asp 1,746
asp.net 11,486
coldfusion 694
database 779
encoding 1,165
javascript 13,332
jquery 1,464
jsp 3,678
mysql 2,177
php 36,698
rss 539
script 457

I need to redirect users to two (2) different pages based on the roles given to them in the database. Only the email and password is submitted on the login page. I have to fetch the role from the database which looks like this: Email | Password | UserType aa@me.com xxxxxx System User bb@me.com xxxxxx Administrator And here is what I have done so far: <?php session_start(); error_reporting(0); include('includes/dbconnection.php'); if(isset($_POST['login'])) { $email=$_POST['email']; $password=md5($_POST['password']); $query=mysqli_query($con,"select ID from gts_users where Email='$email' && Password='$password' "); $ret=mysqli_fetch_array($query); $count=mysqli_num_rows($query); if($ret==1){ $_SESSION['detsuid']=array( 'Email'=>$ret['email'], 'Password'=>$ret['password'], 'UserType'=>$ret['role'] ); $role=$_SESSION['detsuid']['ID']; switch($role){ case 'System User': header('location: dashboard.php'); break; case 'Administrator': …

Member Avatar
Member Avatar
+0 forum 13

my connection to **WebSocket** is getting Disconnected continuously. I'm working in folder `realtime` on `localhost`. How to keep WebSocket connection live? How to use WebSocket in javascript? **Link:** http://localhost/realtime/ <script language="javascript" type="text/javascript"> var myWebSocket = new WebSocket("ws://localhost/realtime"); myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; myWebSocket.onmessage = function(evt) { alert( "Received Message: " + evt.data); }; myWebSocket.onclose = function(evt) { alert("Connection closed."); }; //This line is always true </script> How to insert data to `'generalposts'` table `id, post` field using socket? How to fetch data using socket from above table & fields? I used this too `var myWebSocket = new …

Member Avatar
Member Avatar
+0 forum 3

Can anyone help me with my search engine. I need filter search in the system using PHP. The problem with the code: All the provided fields must be filled up..unless it will not work There were 6 fields such as Remark Status: Industry: Position: Location: Age Range: Min and Max I have to use these fields as the filters,but eventually all the fields must be filled up before it works..How if i provide just one field, let say i fill the position as HR Manager so i did not specify its age and location...Please Help me on this,,, if(isset($_GET['advance_searching'])){ if …

Member Avatar
Member Avatar
+0 forum 14

the below code is to list the running exe files in the windows task manager. but i need only the running applications in windows task manager. if aybody knows pls help me by sending code for this. i am awaiting pls. import java.io.*; import java.util.*; public class GetProcess { public static List listRunningProcesses() { List<String> processes = new ArrayList<String>(); try { String line; Process p = Runtime.getRuntime().exec("tasklist.exe /nh"); BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { if (!line.trim().equals("")) { // keep only the process name processes.add(line.substring(0, line.indexOf(" "))); } } input.close(); } catch (Exception …

Member Avatar
Member Avatar
+0 forum 7

I am working on a project for drag and drop items in a shopping cart. For an item dropped into the cart, I am trying to implement jQuery $.ajax. The result back from the PHP is pre-pended with '`' and I can not figure out why. This is the javascript: $('#target').droppable({ drop: function(event,ui) { var id = $(ui.draggable).data('id'); var aisle = $(ui.draggable).data('aisle'); $.ajax({ url : base_url+'/index.php/groceries/jquery_append_to_list', cache : false, type : 'post', data : { 'id' : id, 'aisle' : aisle }, success : function(data) { $('#target').append('<p data-id="'+id+'" data-aisle="'+aisle+'" class="draggable">'+data.item+'</p>'); } }) } }); This is the PHP script: function …

Member Avatar
+0 forum 0

hi brothers , i work on a ASP.NET MVC Project, please i try to get a cookie who created already using server side C# , and in a pure HTML page not .CSHTML i talk now about .HTML page , in this page i want to using javascript to read the value of the cookie that i created using C# . i wish if anyone can help me and thanks so much in advance.

Member Avatar
+0 forum 0

Hlo Plz anyone give a coading of classic asp i want to save my csv and excel file in databse

Member Avatar
+0 forum 0

Hi guys, I have the following code that I just cannot get to work! Can you please let me know where I have gone wrong? <?php //db_connect.php $con=mysqli_connect("localhost","root","password","database"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } function get_file_extension($file_name) { return end(explode('.',$file_name)); } function errors($error){ if (!empty($error)) { $i = 0; while ($i < count($error)){ $showError.= '<div class="msg-error">'.$error[$i].'</div>'; $i ++;} return $showError; }// close if empty errors } // close function if (isset($_POST['upfile'])){ // check feilds are not empty if(get_file_extension($_FILES["uploaded"]["name"])!= 'csv') { $error[] = 'Only CSV files accepted!'; } if (!$error){ $tot = 0; $handle = …

Member Avatar
Member Avatar
+0 forum 6

Hi DW. If you check [this](https://iwpe.000webhostapp.com/iwpe/) you will notice that at the bottom right hand side there's an added image which is also a link for the hosting site, note that I own the site you will see and I'm not the one who added that image but it was added automatically I believe with javascript by the host during the upload. What I want to achieve is something similar to that or exactly that but obviousely the link and image, title will be different but I want my script which first perform some verification from data base by posting …

Member Avatar
Member Avatar
+0 forum 1

I made sorting arrows for a table in illustrator and exported it out as an svg. I want to place them in a table head, and use css to style it. I will be using javascript (vannila) to swap classes to change the state of my icon. What is the best tag to use for svg in my case? below is sample of what I have now <thead> <tr> <th id="step">Step<img class="sort" src ="assets/sort-up-and-down-arrows-couple.svg"></th>

Member Avatar
Member Avatar
+1 forum 6

This is the code behind the demo at https://www.daniweb.com/connect/oauth/demo

Member Avatar
+0 forum 0

I have some simple scripts like blogs, forums, and so on. They are not of high quality but I want to sell them. The problem is that I cannot build a professonal website. But I want to sell my work. Where can I find a marketplace for such items? Note that I can't sell with Themeforest because they have a strict moderation.

Member Avatar
Member Avatar
+0 forum 4

i want to display the stored image in fdpf.

Member Avatar
Member Avatar
+0 forum 40

Receiving error - Warning: Missing argument 4 for Get_All_Orderlines_Range(), called in /home/download/domains/1ecommerce.com/public_html/dev/_cms/list_orders.php on line 184 and defined in /home/download/domains/1ecommerce.com/public_html/dev/_cms/list_orders.php on line 161 Line 161: function Get_All_Orderlines_Range($id, $all = "", $from_date, $to_date){ $sql = "SELECT * FROM orders"; $sql .= " INNER JOIN orderline on orders.OR_ORDER_NO = orderline.OL_ORDER_NO"; $sql .= " WHERE OR_CUSTOMER_ID = '$id'"; if($all != "ALL"){ if($from_date != "" and $to_date != ""){ $sql .=" AND (orders.OR_DATE_CREATED BETWEEN '" . $from_date . "' AND '" . $to_date . "')"; } } $sql .= " ORDER BY orderline.OL_ORDER_NO"; //echo $sql; return FetchSqlAsObjectArray($sql); } Line 184: $orderlines = Get_All_Orderlines_Range($printed, pack_calendar_date($from_date, "from"), …

Member Avatar
Member Avatar
+0 forum 6

How I can get current date and 15 days back date from current date in 'Y-m-d' format ?? e.g. if current date is 2011-06-21 then $currentdate=2011-06-21 and $dateback=2011-06-06;

Member Avatar
Member Avatar
+1 forum 9

You might be familiar with the dreaded blank page when your PHP script doesn't work. Here's how to spit out errors to the screen, instead of getting just a blank page, as well as logging errors to a file.

Member Avatar
+0 forum 0

There are two ways to write to a file in PHP. You can either open a stream, and write to it in parts, or you can use `file_put_contents()` which is much more convenient, with the trade off being that it takes up much more memory, and is not ideal if you want to send a *lot* of data upstream.

Member Avatar
+0 forum 0

If you need your PHP script to redirect to a different website, you can send an HTTP header to do that. Remember, `header()` must be called before any actual output is sent, which includes not just HTML, but blank lines, etc.. as well.

Member Avatar
+0 forum 0

This code dynamically generates a clear 1x1 pixel.

Member Avatar
+0 forum 0

I'm looking for some alternatives to Swagger UI that I can use with my API's swagger file to generate our official documentation. So far I've been looking at Apiary and ReDoc. Does anyone have any favorites? Which are the most intuitive for api documentation? Ideally I'd be looking for one with a built-in console.

Member Avatar
Member Avatar
+0 forum 1

hi, i have installed XAMPP, but i would like to run my localhost from another computer..

Member Avatar
Member Avatar
+3 forum 16

Got Client with need of **"online print shop"** Client is providing paper printing (like business cards, flyers), printing on cloths, office stationary, logo embroidery on any type of clothing. Client provided some examples. **Links** * [rockdesign](https://www.rockdesign.com/) * [moo](https://www.moo.com/ca/) * [readyprint](https://www.readyprint.ca/) * [vistaprint](https://www.vistaprint.ca/) * [printshop](https://printshop.ca/) * [printvenue](https://www.printvenue.com/) **Where do I start?** Which platform should I choose? 1. CorePHP 2. Wordpress 3. WooCommerce 4. Magento 5. Prestashop 6. WordPress Is there any plugin or script that should I go for???

Member Avatar
Member Avatar
+1 forum 14

Hi, I have a working account generator, which passes the password to mysql with MD5. I am currently working on a forgot password script, which generates a new password and stores as md5, then emails the user, however, the new password is not recognised. This is the forgot script. Can anybody see where the issue lies? If required i can post the login execution script [code] <?php session_start(); // Start Session session_register("session"); include 'connect.php'; // This is displayed if all the fields are not filled in $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>Click <a …

Member Avatar
Member Avatar
+1 forum 7

Hi group, I'm attempting to write code to check to see if an existing account number exists. The user is to input a 10 digit account number. The code then is to query the database to see if that number exists. If it does, the message box displays the message that the number exists. However the code I've written isn't working as I wish. Can you offer some suggestions as to how to do this correctly? Here's what I've attempted: Private Sub tbxAccountNo_TextChanged(sender As Object, e As EventArgs) Handles tbxAccountNo.TextChanged If GlobalVariables.custpnl1 = 2 And tbxAccountNo.Text.Length = 10 And IsNumeric(tbxAccountNo.Text) …

Member Avatar
Member Avatar
+0 forum 2

This is my first time to set up a PayPal masspay. I don't know what variables should I put in my HTML form. Here is the form: <form action="https://www.paypal.com/cgi-bin/webscr" method="POST" name="_masspay"> <input type="hidden" name="cmd" value="_masspay" /> <input type="hidden" name="receiver_email_1" value="support@example.com" /> <input type="hidden" name="receiver_email_2" value="paypal@example.com" /> <input type="hidden" name="mc_currency_1" value="USD" /> <input type="hidden" name="mc_currency_2" value="USD" /> <input type="hidden" name="item_name_1" value="item name" /> <input type="hidden" name="item_name_2" value="website fees" /> <input type="hidden" name="amount_1" value="10.00" /> <input type="hidden" name="amount_2" value="2.00" /> <input type="hidden" name="custom" value="1" /> <input type="hidden" name="return" value="https://www.example.com/buy/12" /> <input type="hidden" name="cancel_return" value="https://www.example.com/buy/12" /> <button type="submit">Pay With PayPal</button> </form> I don't …

Member Avatar
Member Avatar
+0 forum 9

I'm a novice in PHP and I would like to know on how exactly could I define said row. Any helps/tips are appreciated. Thank you in advanced! function add_review() { if(isset($_POST['add_review'])){ (THE UNDEFINED ROW) **$product_id = $row['product_id'];** $review_name = escape_string($_POST['review_name']); $review_email = escape_string($_POST['review_email']); $review_content = escape_string($_POST['review_content']); $review_created = date("Y-m-d H:i:s"); $rating = escape_string($_POST['rating']); $review_query = query("INSERT INTO reviews(review_id, product_id, review_name, review_email, review_content, review_created, rating) VALUES('NULL', '$product_id', '$review_name', '$review_email' , '$review_content' , '$review_created' , '$rating')"); confirm_query($review_query); set_message("Thank you for the feedback!"); }}

Member Avatar
Member Avatar
+0 forum 1

Hi all, I am very new to PHP and MYSQL and have a class assignment I need help with. I am trying to make a page with an HTML form that will update my MYSQL database. You can view my pages online here: [URL="http://baileyjumper.aisites.com/Scripting-Week7/homework4/exercise-five.php"]http://baileyjumper.aisites.com/Scripting-Week7/homework4/exercise-five.php[/URL] I need help with the "Edit" section, if you look online. Here is the code for my Edit page: [CODE=PHP] <?php $hostname = "localhost";//host name $dbname = "baileyjumper_imd203";//database name $username = "baileyjumper_imd";//username you use to login to php my admin $password = "chris4ever";//password you use to login //CONNECTION OBJECT //This Keeps the Connection to the Databade …

Member Avatar
Member Avatar
+0 forum 21

I have predefined value like shipping_weight = 10$, my form consisting two dropdown list, if the dropdown selected based on the selection how to return my ajax value, Index.php : <tr> <th>I have : </th> <td> <select id="old" name="i_have"> <option value = "select_option">Select Option</option> <option value = "three_compact">3 Compact</option> <option value = "three_regular">3 Regular</option> <option value = "three_triple">3 Triple</option> <option value = "five_compact">5 Compact</option> <option value = "five_regular">5 Regular</option> <option value = "five_triple">5 Triple</option> <option value = "seven_compact">7 Compact</option> <option value = "seven_regular">7 Regular</option> <option value = "seven_triple">7 Triple</option> <option value = "nine_compact">9 Compact</option> <option value = "nine_regular">9 Regular</option> <option …

Member Avatar
+0 forum 0

I have a search form, and I want to change the url from: https://www.example.com/search?search=term+term to: https://www.example.com/search/term+term I know how to use htaccess, but I don't know how to send user to friendly URL after he submit the form. Here is my form: <form action="search" method="get"> <input type="text" name="search" id="Searchx" placeholder="Search Marketplace" /> </form>

Member Avatar
Member Avatar
+0 forum 2

I am required to change ip adress everytime this function gets executed I am trying this code below .But I am completly confused.How can I do this function getData($domainName, $ext) { $proxy = array( 1 => array( '88.255.101.247', '8080' ), 2 => array( '176.53.2.122', '8080' ), 3 => array( '37.123.96.237', '8080' ) ); shuffle($proxy); $servers = array( "biz" => "whois.neulevel.biz", "com" => "whois.internic.net", "us" => "whois.nic.us", "info" => "whois.nic.info", "name" => "whois.nic.name", "net" => "whois.internic.net", "tv" => "whois.nic.tv", "ru" => "whois.ripn.net", "org" => "whois.pir.org", "com.tr" => "whois.nic.tr", "gen.tr" => "whois.nic.tr", "web.tr" => "whois.nic.tr", "k12.tr" => "whois.nic.tr", "org.tr" => "whois.nic.tr" ); …

Member Avatar
Member Avatar
+0 forum 1

The End.