39,402 Topics

Member Avatar for
Member Avatar for raine

<? $connect = mysql_connect("localhost", "adamf", "adamf123") or die ("Wrong password, jerk."); mysql_select_db ("adamf"); $insert="INSERT INTO product (product_id, product_name, product_type, product_brand, product_year) VALUES (1, 'Cyber', 1, 1, 2001), (2, 'Motive', 8, 1, 2005), (3, 'Oracle', 8, 2, 2005)"; $results = mysql_query($insert) or die(mysql_error()); $type="INSERT INTO producttype (producttype_id, producttype_label) VALUES (1, 'Heads'), …

Member Avatar for get-innocuous
0
864
Member Avatar for PF2G

Hi, I'm trying to do a list of news, but i only want today's news and news from the past what i don't want is future news(tomorrow,...). So i'm doing if the date <=$curdate, but future news appear anyway, can you help me, plz? <?php $curdate = date("d/m/Y"); $row_noticias = …

Member Avatar for diafol
0
100
Member Avatar for accra

This is the error i get form my error_log on my server online PHP Warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in /home1/zxx/public_html/admin/userindex/sms/sms.php on line 127 i looked in all of the code but can't find why that error. Here is the code, it's an sms app writing in php. …

Member Avatar for pritaeas
0
165
Member Avatar for ranjit_mahadik

i have created database for our site. but i wanted to know that how can i secure my website using session.

Member Avatar for diafol
0
75
Member Avatar for Majestics

i am working on a web project which upload file on server, i am using uploadify for this. I have used this with wamp where it worked like a charm but when i tried in the server side it failed.. any suggestions. I have done many tricks but none of …

Member Avatar for pritaeas
0
279
Member Avatar for nikki05

Hi With the code snippet given in the following post http://www.daniweb.com/web-development/php/threads/126361/csv-file-uploading-into-a-mysql-database I am able to import csv data into phpmyadmin. However, I am getting an error if csv data contains a text with apostrophe (‘) symbol (e.g. my book’s name is abc). Appriciate any suggestions to resolve this error. Thank …

Member Avatar for nikki05
0
428
Member Avatar for arctushar

function memory($user,$ayat){ sqlconnection(); $user = mysql_real_escape_string($user); $ayat = mysql_real_escape_string($ayat); if((checkmemory($user,$ayat)==0) || !(checkmemory($user,$ayat)==0)){ $sql="INSERT INTO `mark` ( `user_id` , `ayat` ) VALUES ( '".$user."', '".$ayat."' )"; mysql_query($sql); return $sql; } } function checkmemory($user,$ayat){ sqlconnection(); $user = mysql_real_escape_string($user); $ayat = mysql_real_escape_string($ayat); $sqlmemory="SELECT * FROM `mark` WHERE `user_id` = '".$user."' AND `ayat` =".$ayat; …

Member Avatar for Biiim
0
189
Member Avatar for naresh.giri.146

<?php session_start(); include "conn.php"; if (isset($_POST['submit']) && $_POST['billno']!='' ) { $bill = $_POST['billno']; $query = mysql_query("SELECT bill_no, tag_no FROM tbl_cargo_details WHERE bill_no='$bill' or tag_no ='$bill'") or die(mysql_error()); while ($row = mysql_fetch_assoc($query)) { if($bill == $row['bill_no'] || $bill == $row['tag_no']) { header("location:true.php?bill=$bill"); } else { header("location:false.php?bill=$bill"); } } else { ?> …

Member Avatar for Biiim
0
356
Member Avatar for Djmann1013

Hi. I am having trouble with this script: <?php $host="mysql.host.com"; // Host name $username="username"; // Mysql username $password="password"; // Mysql password $db_name="DB_NAME"; // Database name $tbl_name="table"; // Table name $myusername = $_SESSION['myusername']; // Session on login page, in a variable. // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or …

Member Avatar for diafol
0
158
Member Avatar for aneeqtariq_143

hi i want to create table in php but i dont know how many row are in database. but i want to show 2 records per row. please help me how can i do that ?? here is my code but it wasnt work as i desired it create i …

Member Avatar for broj1
0
128
Member Avatar for nova37

hello i have website http://www.w3db.org Problem :: problem is that it cant load or load after 2 ot 3 minutes which is quite strange i do not know where is the problem script is OK so please somebody check it that the problem is with me or others user face …

Member Avatar for nova37
0
108
Member Avatar for Djmann1013

Hi. I wanted to make a page that I can update a table in a database. But for some reason, I get this error: ***Warning: mysql_query() [function.mysql-query]: Access denied for user 'a1092592'@'localhost' (using password: NO) in /home/a1092592/public_html/folder/file.php on line 10*** and this error: ***Warning: mysql_query() [function.mysql-query]: A link to the …

Member Avatar for Djmann1013
0
259
Member Avatar for dualzNZ

hi all im having a issue with non selected checkboxes when i select checkboxes and hit submit they go into the database ok but the checkboxes that have not been selected are adding 0 to the database code below: <form action="addeventusers.php?evid=<?php echo $evid; ?>&u=<?php echo $u; ?>" method="post"> user 1 …

Member Avatar for ckchaudhary
0
102
Member Avatar for udaydesai

Please anybody help me out in installing gearman php extension on windows xp. I have xampp 1.7.7 installed on my system and i have installed Cygwin, libevent-1.4.14b-stable and gearmand on my system. Please let me know what more is needed to install gearman-1.0.2 php extension. As when i run the …

Member Avatar for cereal
0
368
Member Avatar for Senyo

# Heading Here # Please assist me on this one. I have two DB's, one keeps track of user and system activities and the other keeps track of only user activities. The purpose of the codes below is to first of all retreive all tables from the second DB. These …

Member Avatar for Senyo
0
114
Member Avatar for Djmann1013

Hi. I am having a problem with PHP. I got these lines of code: <?php include('Include Stuff') ?> <html> <center> <h1>Admin Login.</h1> <form action="(Action Script)" method="POST"> Admin Name: <input type="text" name="name" /><br /> Password: <input type="password" name="code" /><br /> <input type="submit" value="Login" /> </form> </html> And this: (the action script …

Member Avatar for sepp2k
0
229
Member Avatar for yhkesh

Sir Please suggest a way to compare values in a column of excel sheet so that if same values are appeared i can update using php I have a column named Name which stores Names of students,if same student entry is appeared i need to update Thanks

Member Avatar for yhkesh
0
120
Member Avatar for rayidi

We all know how to open a mailbox using `imap_open`. Here the problem is i'm creating a maill system here. I'm not able to find to create a mail account with `imap/pop3` in `php`. Is it is possible ? Assume suppose my domain is www.studentmug.com. I want to create a …

Member Avatar for ckchaudhary
0
342
Member Avatar for Djmann1013

Hi, I am trying to check if a certain username is in a session. This is what I have so far... <?php if ($_SESSION=='Djmann1013') { // Do the work here. } else { // Don't do anything :P } ?> But, when I test this, it does nothing. But when …

Member Avatar for Djmann1013
0
166
Member Avatar for DaveyMoyes

Hi Everyone, I have a foreach array that prints out images one per line. How can I print images out so I have 3 per line ? here is the code I am working with. if (count($friendDataRawArray) > 0) { foreach ( $friendDataRawArray as $id => $friend) { //$name = …

Member Avatar for brandonrunyon
0
179
Member Avatar for Synestic

Hello First of all, I'm new to PHP, and also to Daniweb. I've been looking everywhere for some PHP code to skip to the next line every time my string ($description) has a period in it. So here's an example of what I want to achieve: Text: The car is …

Member Avatar for Dani
1
166
Member Avatar for dani0

Hi, I want to change this code as given 1 result. I don't need 10 line results. I just need 1 line result. When I tried to change 10 with 1 it doesn't work. Please help me about that. while( $row = mysql_fetch_array($query) ) { $id[] = $row['id']; } $id …

Member Avatar for vibhaJ
0
176
Member Avatar for javacle

hi guys, i've been trying to get a work around for this: in a file structure like this: root: -----index.php (file inside root) -----template (folder inside root) -----user (folder inside root) -----products (folder inside root) -----config (folder inside root) i've been tryoing to use dirname(dirname(__FILE__)) inside a file in the …

Member Avatar for diafol
0
629
Member Avatar for sparkles_links

This the form: <div style="border: 0px #000 solid; padding:0px 0 0 5px; width:auto;"><h3 align="center"><b>Job Seeker Application Form:</b></div></h3> <div id="container" class="ltr"><form name="cliform" method="post" action="cli_app_check.php" enctype="multipart/form-data"> <table width="100%" align="center"><tr><td> <table width="100%" align="center" cellpadding="0" cellspacing="10"><tr><td align="right">Title :</td><td width="16%"><select name="title"><option value="000">Select Title</option><option value="Dr.">Dr.</option><option value="Mr.">Mr.</option><option value="Mrs.">Mrs.</option><option value="Miss.">Miss.</option></select></td><td align="right">Surname :</td><td><input name="sname" type="text" id="sname"></td><td align="right">Other Names :</td><td><input …

Member Avatar for rotten69
0
78
Member Avatar for kartiki.mahadik

how to add email adress validation code so the validation will dispaly after immideately entered email adress in text box of email adress

Member Avatar for tyson567
0
140
Member Avatar for ronhymes

Hello, I have PHP code that updates a record in my database. I need to run that code when an <a href="mailto....> link is clicked on, before the email client runs. Thanks for the assistance.

Member Avatar for ronhymes
0
197
Member Avatar for Dani

So I just discovered a crazy bug that has been keeping visitors of the Opera web browser from using DaniWeb. Apparently there's a problem with CodeIgniter's CSRF protection that makes it not work with Opera, and I'm unsure of why. It works perfectly fine with IE, Firefox, Chrome, etc. I …

Member Avatar for diafol
0
312
Member Avatar for UzuNarU

Hey everyone, I'm having a little trouble with creating a 'dynamic' calendar with events called from a MySQL database. So basically I would like to have the Month automatically change when the month changes, and highlight the days which have events scheduled, and make those days links to my thickbox …

Member Avatar for UzuNarU
0
791
Member Avatar for drumichael87

I am developing in WordPress plugins and I would like to know.if someone could guide Me with this issue. I would like to know what's the easier method.of declaring a global variable that I can use. As of now I am not using classes, mostly because i'm not sure how …

Member Avatar for drumichael87
0
181
Member Avatar for SummerNight

I just installed Windows 8 Release Preview and my existing wampserver does not work. I tried installing easyphp and after the service was successfully started it can't find the localhost. Is there any fix to this or other local servers to run php and phpmyAdmin the easy way ? Thanks …

Member Avatar for cuonic
0
153
Member Avatar for tpowell0201

Okay, so I have been trying to get this to work all night, but I can't find anything actually wrong with it. I just thought maybe someone else might be able to just look at it and see the answer... as it's probablly in plain sight. <?php session_start(); mysql_connect("powellintellabs.com", "******", …

Member Avatar for akmozo
0
156
Member Avatar for theonlylos

I currently have a client who came to me asking me how to build a system for him where he can give varying levels of discounts to events based on the number of people who get referred via a unique affiliate link/cookie. The key stumbling block for this project isn't …

Member Avatar for cuonic
0
299
Member Avatar for LastMitch

Hi I'm having problems trying to echo the array, that I created. I'm trying to create a 3-D array. Here is the file: $futures = array(array(array("GC", "Gold", 1,605) (array("SI", "Silver", 27) (array("PL", "Platinum", 1475) (array("HG", "Copper", 3.48)), (array(array("CCS", "Corn", 707) (array("SNS", "Soybeans", 1,525) (array("WCS", "Wheat", 846)), (array(array("CJ", "Cocoa ", 2,335) …

Member Avatar for blocblue
0
364
Member Avatar for sri.
Member Avatar for sri.
0
5K
Member Avatar for zychos

I am trying to create a where clause that loops through my foreach loop. The idea is to have a search with four possible values depending on which values the user fills in. ,<?php $fname = $_GET['fname']; $lname = $_GET['lname']; $nature =$_GET['nature']; $ticket_id = $_GET['ticket_id']; $nbsp = " "; $fields …

Member Avatar for zychos
0
292
Member Avatar for David2012

In an HTML form when I use a radio button how will the php program where the data goes to will know the correct option chosen? in HTML the script will be like: <form action='abc.php' method='post'> <LABLE>YES</LABLE> <input type='radio' name='agree'> <LABLE>NO</LABLE> <input type='radio' name='agree'> </form> Now since both options have …

Member Avatar for David2012
0
16K
Member Avatar for mits28

I'm new to PHP.I'm trying to do something very simple,I have tried to search on google but still i'm not understanding why its not working. I'm trying to send information through a url, and having a script pick it up using the $_GET super global. This is FORM.php script: `<form …

Member Avatar for tyson567
0
195
Member Avatar for Raakesh399

hi, i want to create a website with web services facilities in php. is this possible?

Member Avatar for Raakesh399
0
99
Member Avatar for tyson567

//$time in the second php code hold the time stored in the database in the same format as above(ie TIMESTAMP Format) //Save the first php code as timeago.php //include first php code u saved in the second php code as i have done.. //Use the Second Php code Wherever You …

Member Avatar for tyson567
0
1K
Member Avatar for Subless

I need a little help creating a current page link system that makes the link text bold but not linked. The basic concept is setup like this: <strong>Link 1</strong> <-----------Current page is bold not linked <a href="test.php">Link 2</a> <a href="test2.php">Link 3</a> <a href="test3.php">Link 4</a> The pages that I am not …

Member Avatar for diafol
0
186
Member Avatar for rileyganimator

Not sure if this is in the right forum because I didn't really know where else to ask this, but I need some help with my site. Version of apache on my site: 2.2.17 //not sure if this helps people answer my question or not The problem I'm having is …

Member Avatar for rileyganimator
0
163
Member Avatar for CaptCuffs

Hi guys, I was wondering if anyone can help. I need to count the number of lines of text in an array (they are separated as bullet points at the moment) and after a certain amount of lines, the array will carry on from a new column. Really struggling at …

Member Avatar for Crakken
0
137
Member Avatar for bo0ga

Can you use the input selected from an HTML "<select><option></option></select>" statement and put that within a form to be added to a database? I want the user to select a month and a day and press a button and have it added. Please help.

Member Avatar for akmozo
0
136
Member Avatar for noobphp

Guys I need ur help please >=< I finished adding database and all but i need help with search can someone help me? The description is this Display the student’s id, name and contact number ONLY in tabular format. The data must be sorted according to the student’s id, hence …

Member Avatar for akmozo
0
147
Member Avatar for LastMitch

Hi I'm trying to open a file from my **OS** (**Window 7**) from my web host server. But it can't load the files. I try fget() but it seems like it's not reading it? <?php session_start(); header("Cache-control: private"); include("include/capable.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> …

Member Avatar for LastMitch
0
202
Member Avatar for unrealni

Hey guys I have a problem with my login form.I made a site and i run that site on xampp localhost and it's work fine, but then I transferred files to web hosting and my login form show this error : **"Warning: mysql_num_rows() expects parameter 1 to be resource, boolean …

Member Avatar for diafol
0
375
Member Avatar for xbat

I have two ajax mysql php 2 drop down select that I am populating... i'm doing something stupid... anyone have any suggestions... or pointers....? 1.php <?php require_once('dbconfig.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() …

Member Avatar for xbat
0
409
Member Avatar for naru vaishnaw

here is my code for edit user detail but selected id is not showing .only showing last inserted id. please help me for correct this code.. my view code <?php //connects to database $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users", $con); //select table …

Member Avatar for pritaeas
0
166
Member Avatar for Crakken

Hello there, I'm creating a forum system. On the main page, I display the latest posts, but I want that when it reaches 10 posts, a small menu with numbers appear at the bottom, that links to next page so people can see other posts, for example, like the one …

Member Avatar for Crakken
0
148
Member Avatar for Crakken

Well, I can't say it correctly, I'm sure the title is not what I meant, I just didn't know how to say it... But anyways, I inserted some text in a table in a dtabase, for SQL injection reasons, I stripslashed it or should I say "I used real_escape_string" But …

Member Avatar for diafol
0
143

The End.