Member Avatar

I am trying to allow my users to upload videos to my site and i have the php file upload but it will not work, it worked with images but once i changed it to video it stopped working this is the code <?php $allowedExts = array("mp4", "mov", "avi", "flv","mpg", "wmv", "3gp", "rm"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "video/mov") || ($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/flv") || ($_FILES["file"]["type"] == "video/mpg") || ($_FILES["file"]["type"] == "video/wmv") || ($_FILES["file"]["type"] == "video/3gp") || ($_FILES["file"]["type"] == "video/rm")) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] …

Member Avatar
0
26
Member Avatar

I am doing a start up and am figuring out my stack. I've been using php for around 5 years now and am extremely familiar with it. However, I've recently been introduced to node.js and have seen it is on the rise. I'm not sure what to use for server side. The purpose of my company is e-commerce. Users will have accounts and subscribe to a service. I hope to grow quickly. Would node.js be a good choice or would php be fine?

Member Avatar
0
44
Member Avatar

Here is a link to a list of college names and their .edu email http://pastebin.com/LND21t5F I want to take those lines of code and put the .edu part into one coloumn of a database and the name of the college into another coloumn. My database is structure like this (id, college_email, college_name) Can some one help me do this?

Member Avatar
0
14
Member Avatar

Okay I have a html upload form here, What is does is displays a browse button so users can upload files to my site, what I want them to be able to do is completly rename the file that they are uploading once they upload it to my site, but always add the extensions .mp4, so say I upload a video named sample123.mp4 and I rename the video to funny. I want the file to be saved in my directory as funny.mp4. But be saved into my database table as funny. <?PHP require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("login.php"); exit; } ?> <!DOCTYPE …

Member Avatar
0
33
Member Avatar

I have a domain name lets say. mydomain.com and it has a hosting account. But I also have another domain name, mydomain2.com that doesnt have a hosting account. How can I make mydomain2.com go directly to mydomain.com? I am using Host Gator

Member Avatar
0
14
Member Avatar

I have a div that has an image as its background. But the image only covers up about 80% of the screen. I want to make the extra 20% of the screen to be black but its only coming up as white. How can I set the background images and the background color? This is my css, #first_section_main{ top:77px; min-width:1000px; width:100%; position:relative; height:500px; background-color:#3d3d3d; background: url(../images/first_section_bg.jpg) no-repeat center center; } How can I make the background color #3d3d3d?

Member Avatar
0
21
Member Avatar

I have an account with Host Gator that allows me to create my own email address's. I created my own email address, lets say its called "myemail@mydomain.com". Now I have a PHP script that automatically send out emails to users but when the emails are sent they are sent by my servers defualt email address. There is no way for me to change my servers default email address so how can I make the PHP mail send emails from the myemail@mydomain.com?

Member Avatar
0
22
Member Avatar

I have a link that once clicked is suppose to make a div visible. So far it does but it only makes the div visible for a second then it returns to being invisible. I gave the div the value `display:none;` in Css and the javascript gives it the value `display:block;` in the onlcick function. Here is my Html and Javascript <script> function blackBox() { document.getElementById("black_box").style.display='block'; document.getElementById("terms_and_agree").style.display='block'; } </script> <a href="" style="color:#3d3d3d;" onclick="blackBox()">Terms and Agreements</a> How can I stop the div from only flashing??

Member Avatar
0
14
Member Avatar

I am trying to create a website where users post onto a forum and leave and email adress so others can respond to the forum post but I want the email adress they leave to be encrypted like Craiglist does. So if my email is myemail@gmail.com it will be posted as ek34jf@gmail.com and people can email the encrypyed email. How can I implement this into my website?

Member Avatar
0
10
Member Avatar

I have a database which has multiple tables. I want all the table names to be displayed in a drop down html menu. I have a php function which I call on my html document. function namealbums() { $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } $query = mysql_query(" USE photos GO SELECT * FROM sys.Tables GO"); echo '<select name="dropdown">'; while ($row = mysql_fetch_array($query)) { echo '<option value="'.$row.'">'.$row.'</option>'; } echo '</select>'; } ?> This is my HTML form which calls the function. <table width="300px" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td cellpadding="100"> <?php echo namealbums();?> …

Member Avatar
0
52
Member Avatar

Hello I have a simple for and PHP that uploads multiple images to a file. The problem is I want these images to be resized when they are uploaded. Does anyone know of a simple way to resize these images with PHP? I am not a professional so further explaining would be helpful. Here is my current HTML form and PHP upload script. <?php if(isset($_FILES['files'])){ $errors= array(); foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){ $file_name = $key.$_FILES['files']['name'][$key]; $file_size =$_FILES['files']['size'][$key]; $file_tmp =$_FILES['files']['tmp_name'][$key]; $file_type=$_FILES['files']['type'][$key]; if($file_size > 10097152){ $errors[]='File size must be less than 2 MB'; } $query="INSERT into upload_data (`USER_ID`,`FILE_NAME`,`FILE_SIZE`,`FILE_TYPE`) VALUES('$user_id','$file_name','$file_size','$file_type'); "; $desired_dir="uploads"; …

Member Avatar
0
32
Member Avatar

Hello, I have a few links that I have given a relative position. They have the widths set to 200px, however they do not follow this at all and only have the width wrap around text. When they had the position of float, they followed the width rule of 200px. I have no idea why they are not following the width rule, here is the CSS ul a{ background:rgba(0,0,0,.4); font-size: 15px; position:relative; height:50px; left:0px; color:#FFFFFF; width:200px; padding:2px; margin:0px; padding-right:15px; padding-left:20px; margin-left:-40px; font-family:"Arial Black", Gadget, sans-serif; text-decoration: none; text-shadow: 3px 3px 3px #333; } Thanks for looking! This is the HTML …

Member Avatar
0
8
Member Avatar

Okay so I have an android app called Rate My Plate and it needs users. I mean it needs a lot of users. It's an app where if there are a low amount of users then it's pointless but the more users the better it is. Now I have tried posting on some forums but not much luck. Does anyone have any idea where I can post about my app and some people will actually read it? I tried posting here but only got 2 hits.

Member Avatar
0
17
Member Avatar

I have a query that collects multple ID numbers and stores them into a php Array. I then want to make a mysql query for every result in the php Array. I believe I am on the right track but am getting an error saying the `join()` method has invalid arguments. $IdArray is a valid array and does have Ids stored in it, I am 100% sure. Here is my code, $secondArray = array(); $ids = join(',', $IdArray); $query = "SELECT * FROM test WHERE user = '$user' AND id IN ($ids)"; $results = mysql_query($query); while($row = mysql_fetch_array($results)){ $secondArray[] = …

Member Avatar
0
23
Member Avatar

OKay so this my have been asked before but I have more of a general question than an issue. I don't understand Mysql_num_rows() becuase I don't have any information within my database table so the number or rows should be 0 but what happens is I get an error and it says that Mysql_num_rows is not a valid argument. How can I find out then if there a piece of data within in a table without using mysql_num_rows()?

Member Avatar
0
10
Member Avatar

I can not access the database with Mysqli_connect(). I have all the correct information into the funciton but it wont let me. This is the syntack that I use $link = mysqli_connect("hostname", "username", "password", "db_name"); I get this error 10-01 22:20:27.182: E/JSON(8700): <br />n<b>Warning</b>: mysqli_connect() [<a href='function.mysqli-connect'>function.mysqli-connect</a>]: (42000/1044): Access denied for user 'username'@'%' to database 'db_name'

Member Avatar
0
13
Member Avatar

Hello, this is a broad question but I need help selecting a webhost. Currently I am with GoDaddy and they are a great hosting site. The problem I have is they only allow 1GB how data to be stored in a database. They do allow unlimited databases but I am not interested in that. I want to have unlimited data storage for my database or at least a significant amount. Does anyone know of a web hosting site where they are no limits on the amount of data allowed to be stored in one mysql database? Or at least a …

Member Avatar
0
10
Member Avatar

How can I replace <br>, \r, \n with " ". Which is an empty space. Is there a way to detect these characters in a string and replace them with a single white space?

Member Avatar
0
53
Member Avatar

I want to remove all enters from an input and replace them with a single space. By that I mean something as </br>. So if someone places the input like this Hello, my name is bob. How are you? It will look like this, Hello, my name is bob. How are you? How can this be done in php?

Member Avatar
0
19
Member Avatar

I have a query that selects data and places it into an array. This array can contain 'null' as a results. I want to remove all the varaibles that say 'null'. I have a code that is suppse to remove all the null variables but instead it replaces them with numbers? Here is my Code $query = "SELECT * FROM test WHERE $info = '$search1' ORDER BY id DESC"; $results = mysql_query($query); while($row = mysql_fetch_array($results)){ $Array[] = $row['first_names']; $Array[] = $row['last_names']; }//end while mysql_fetch_array foreach (array_keys($Array, 'null') as $key) { unset($Array[$key]); } The results I get look like this [ …

Member Avatar
0
25
Member Avatar

I have a code that places the time into a database in the format Year-Month-Date Time. The time isnt in Pm or Am. I want to change the code from that into Month/Day/Year and the time in am or pm. Is this possible? Or should I be using a different method to placing the date into the database?

Member Avatar
0
28
Member Avatar

I have a database that contains multiple comments. Each comment has their own ID. I want to select 5 comments from the database, store the last comments ID into a variable and then select 5 more comments at a later time. When I collect 5 more comments at a later time I need them to have an ID larger than the previous comments ID that was stored in the variable. I will try to make a code so it is easier to understand. $commentID = 0; $query = "SELECT * FROM comments WHERE commentID > '$commentID' LIMIT 5"; I have …

Member Avatar
0
20
Member Avatar

I have a mysql query that seperates an array of variables and uses each variables to compare inside the database. The query uses a OR clause and I want to make it so it can also use an AND clause. The trick is I want the left side of the query to use the OR clause and the right side use the OR and AND clause. This probably doesnt make sense so let me try to make an example code. $query = "SELECT * FROM table WHERE name ='$name' OR (number ='$number' AND number2 = '$number2')"; I have not tried …

Member Avatar
0
17
Member Avatar

This is my xml layout for the log in page <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="@dimen/activity_vertical_margin" > <!-- Logo --> <TextView android:id="@+id/headText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="60dip" android:textSize="45sp" android:fontFamily="sans-serif" android:textColor="#FFFFFF" android:textStyle="bold" android:layout_gravity="center" android:gravity="center" android:text="@string/logo" /> <!-- Email TextField --> <EditText android:id="@+id/loginEmail" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="text" android:hint="@string/username_text" android:fontFamily="sans-serif" android:textSize="15sp" android:layout_marginTop="100dip" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" /> <!-- Password TextField --> <EditText android:id="@+id/loginPassword" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="textPassword" android:hint="@string/password_text" android:textSize="15sp" android:fontFamily="sans-serif" android:layout_marginTop="20dip" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" /> <!-- Error message --> <TextView android:id="@+id/login_error" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#e30000" android:padding="10dip" android:textStyle="bold" android:layout_gravity="center" android:gravity="center"/> <!-- Login Button --> <Button android:id="@+id/btnLogin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20sp" android:textColor="#FFFFFF" android:textStyle="bold" android:paddingTop="10dip" android:paddingBottom="10dip" android:background="@drawable/login_button_corners" android:fontFamily="sans-serif" …

Member Avatar
0
15
Member Avatar

I have a query in php that has an offset in it. I want the offset value to be a variable but I am not sure how to do so. This is my query but it comes up as an error. $query = "SELECT * FROM comments WHERE `commenter_username` IN (" . join(',', $list) . ") OR `Number` IN (" . join(',', $list) . ") ORDER BY `comment_id` DESC LIMIT 1 OFFSET $offsetNumber"; What is wrong with this?

Member Avatar
0
8
Member Avatar

Hello, I have a mysql query $query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") ORDER BY comment_id DESC"; I want the query to select one row, the row with the highest id. Then store that id into a variable and then select a row thats id is lower than the previous id. so im thinking it would look something like this $query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . …

Member Avatar
0
16
Member Avatar

I know this has been asked a thousand times in other locations but I have tried many solutions and can not get an answer. I have two divs, one called overlay and one called image_case. The overlay covers the entire page, then the image_case is suppose to be in the center of the overlay div. But the image_case doesnt have a set width becuase a new image is always placed inside of it, so i can not get the div to be centered. <div id="overlay"> <div id="image_case"> <a href="#"><img src="uploaded_images/6a829a83a66232a390ceabf942c6e02b.png" /></a> </div> </div> CSS #overlay{ position:absolute; position:fixed; z-index:1; width:100%; height:100%; …

Member Avatar
0
44
Member Avatar

Hello, I have a php script which detects if an image is vericle or horizontal. Then it resizes it to my certian specifications. An issue is I want the script to resize the image and then create a thumbnail image as well. The script works when resizing an image but I cant make it create the thumb nail. This is the script. <?php include('SimpleImage.php'); //connect to database $hostname = "localhost"; $username = "root"; $password = ""; $database = ""; $con = mysql_connect("$hostname","$username","$password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$database", $con); $id = (md5(time())); $thumb = (md5(time())); …

Member Avatar
0
23
Member Avatar

Hello I have made a website for a cake making business and its my first website I am making for a customer and would like some input from some outsiders. I have only made the home page because I am not sure about my layout and if it looks good. Please comment any changes I could do to make the web page better looking or tell me if you think its suitable for a cake making website. I can handle criticism so don't be afraid to hurt my feelings lol. ![81ed113db0448c3322468448f6945c86](/attachments/large/3/81ed113db0448c3322468448f6945c86.PNG "81ed113db0448c3322468448f6945c86") ![58043bb7c3de966efd662f16c901805c](/attachments/large/3/58043bb7c3de966efd662f16c901805c.PNG "58043bb7c3de966efd662f16c901805c") Here is a picture of the …

Member Avatar
1
62
Member Avatar

I have a website that has 2 jquery sliders. This webisite works perfectly fine with both of them. I then created another site with the same exact code for 2 jquery sliders and this site will only run one slider and I can't find the problem! This is the html for the website that works <!DOCTYPE HTML> <html><head> <meta charset="utf-8"> <title>Blake Photography</title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="maincss.css" /> <style type="text/css"> /* New in version 1.7+ */ #slider1 { width: 400px; height: 300px; list-style: none; } #slider2 { width: 170px; height: …

Member Avatar
0
17

The End.