- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 2
- Upvoting Members
- 4
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
63 Posted Topics
Re: If you are allowed only for 60kb. the trick is split the file, if you have 120kb split in to two. then create a php script to merge. then call mergescript.php after all split files upload. everything is possible :D cheers | |
Re: or maybe you can use fetch_array(). $query = mysql_query(select column from table); while($row=mysql_fetch_array($query)){ echo $row['column']; } | |
Re: assuming you already have the list of file like this foreach($files as $file){ echo $file ." | <a href='delete.php?file=$file'>Delete</a><br/>"; } delete.php also check dir/file permission to other allow read/access/delete <?php $file = "path/to/file/$_GET[file]"; if (!unlink($file)) { echo ("Error deleting $file"); } else { echo ("Deleted $file"); } ?> ![]() | |
Re: Update large number of records may cause slow performance. I suggest to use bulk update. and hopefully these may help you soon if you need it. update multiple records in 1 query UPDATE mytable SET title = CASE WHEN id = 1 THEN 'I'm alive'; WHEN id = 2 THEN … | |
Re: add link field in table example link_id, in link_id field contain the id of FK or PK of other table you want to link to this table. All table should have a link_id so its easy for you to manipulate data. sorry for my bad english.. | |
| |
Re: [code] echo $sql //check personID value !empty, If PersonId not empty but still dont get the process, do ZER13 suggestion [/code] | |
| |
Re: check user ip how many times it access to your website then try to use captcha | |
Re: 1) How do I dynamically create the link (and the new URL) with PHP and MySQL? [code] //ex $query= mysql_query("select url_fields,name from table_name"); while($row=mysql_fetch_array($query)){ echo '<a href="'.$row['url_fields'].'">'.$row['name'].'</a>'; //this will create dynamic link depend on how you style it. } [/code] 2) And how do I dynamically create the new webpage, … | |
Re: [code] $list = array('a','b','c','d','e','f','g','h'); $ms = '<select size="32" name="abc" id="abc" multiple="multiple" style="width: 276px; height:200px;" class="slct">'; foreach($list as $sl){ $ms .='<option value='.$sl.'>'.$sl.'</option>'; } $sms .= '</select><br> //to insert in db table $multiselect = explode(",",$_POST['abc']); foreach($multiselect as $selected){ mysql_query = ("insert into table_name (selected_let) values ('$selected')"); } [/code] ![]() | |
Re: as evstevemd said,use some trick like addslashes to escape ' [code] //example //when submit or click login $uname = $_POST['username']; $pwd = $_POST['password']; $query = mysql_query("select * from profile where username='".addslahes($uname)."' and password='".addslahses($pwd)."' "); [/code] or you can use $_SERVER['PHP_AUTH_USER'] or visit this link for more info [url]http://php.net/manual/en/features.http-auth.php[/url] ![]() | |
Re: //in terminal //if you are a sudoer or if you have a root prev sudo chmod 777 -R /var/www //then enter youre password //if you cant sudo, then be root su //enter root password chmod 777 -R /var/www of if you are log in as admin, just go to /var … | |
Re: try this, let me know if theres an error [code] echo '<li><a href="p1/?ID='.$_GET['ID'].'&page='.$value.'">'.$value.'</a></li>'; [/code] ![]() | |
Re: nothing will happen to your account table its becasue you update the record that doesnt exist. insert record before update | |
Re: [code] $age = 75; $current_year = 1891; $the_day_you_born = $current_year - $age; //minus the age in the current year [/code] ![]() | |
Re: this will read text file by line, but you can slip each line with explode [code] <?php $txtfile = file('testfile.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($txtfile as $t){ echo $t."<br><br>"; } ?> [/code] ![]() | |
Re: if you intend to search for specific result use where clause [code] //if you are trying to concat dont forget to add (.) mysql_query("SELECT*FROM Products where field_name ='".$result."'"); [/code] | |
Re: if youre goal is to make webapp, try to visit www.salesforce.com . | |
Re: [QUOTE=chrishea;1567080]If you want help, then you need to demonstrate some effort and provide an initial design with some specific questions. If you can't get that far on your own, then maybe you don't deserve to graduate! There are lots of reservation systems out there and that probably includes some open … | |
Re: [code] <?php //if you already have country in youre database you can use it this way //you dont need to write hundreds of country $country =''; $getcountry = mysql_query("select country_name from country_table"); while($row=mysql_fetch_array($getcountry)){ $country .='<option value="'.$row['country_name']."'>".$row['country_name']."</option>"; } >? <select name="country"> <option value="">Select Country</option> <?php echo $country; ?> </select> [/code] or … | |
Re: [code] //change this with basic mysql_fetch_array.. just try $area = $fetch[quickref]; [/code] | |
Re: [code] if(isset($_POST['submit'])){ mysql_query("delete from table_name"); mysql_query("insert into table_name (column1,column2) values ('value1','value2')")or die(mysql_error()); } [/code] | |
Can somebody help me please? i try to generate an xls(excel) file using this code, all format work fine except the cell size(width). can anyone help me how to format the cell width? [code] </php . . . $workbook = new Spreadsheet_Excel_Writer(); $format_und =& $workbook->addFormat(); $format_und->setBottom(1);//thick $format_und->setAlign('center'); $format_und->setHAlign('equal_space'); $format_und->setBold(); $format_und->setVAlign('vcentre'); … | |
Re: [code] <?php header("location:/path/?id=".$_GET['id']); ?> [/code] | |
Re: See this to get some idea [url]http://jquery.bassistance.de/autocomplete/demo/[/url] | |
Re: @joban.ali: if you dont mind, can you post youre query here? I wonder why ardav suggestions didn't work in youre script.. | |
Re: i already post this on other thread, hope this will help you here's how to get an array input element value [code] $x = array(); for($i=0;$i<$count;$i++){ $x[$i]['abc'] = $_POST['abc'][$i]; $x[$i]['level'] = $_POST['level'][$i]; $x[$i]['level_desc'] = $_POST['level_desc'][$i]; $x[$i]['pc_desc'] = $_POST['pc_desc'][$i]; $q = "INSERT INTO plo_pc(plo_criteria,plo_level,level_dec,plo_desc) values ('".$x[$i]['abc']."','".$x[$i]['level']."','"..$x[$i]['level_desc']"', '".$x[$i]['pc_desc']."') " ; mysql_query($q) or … | |
Re: have you try this already? [icode] <select name="p_name[]" multiple="multiple" size="4"> <option value="" ></option> <option value="1" >1</option> . . . //etc $p_name= $_POST['p_name']; $pname=''; if( is_array($p_name)){ while (list ($key, $val) = each ($p_name)) { $pname .= $val; } } [/icode] | |
Re: [code] mysql("delete from masterdb where url='".$_GET['url']."' and userid='".$_SESSION['userid']."'"); if(!mysql_error()){ header("location:/index.php"); } else { echo mysql_error(); } [/code] | |
Re: I have suggestion jquery and dataTable nice table with paging and neat..easy to use | |
Re: NOTE: This is not my Original script, I just want to help you [icode] <? include 'connect.php'; $filename='temp.csv'; $handle = fopen("$filename", "r"); while (($data = fgetcsv($handle, 3000, ",")) !== FALSE) { $import="INSERT into inventory(tool_id,process,manufacturer,model,description) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]');"; mysql_query($import) or die("mysql_error()"); print $import."<br>"; } fclose($handle); print "Import done"; ?> [/icode] | |
Re: I think you miss to close the form </form> try to [icode] //in login02.php //after <? //add print_r($_POST); to see if field empty or not [/icode] | |
Re: is this the output that you mean? <select name="select"> <option value="">select option</option> <option value="Home">Home</option> <option value="Work">Work</option> //and so on </select> if y then //query from section table $a = mysql_query("select Section_Name from Section"); echo '<select name="select">'; while($b = mysql_fetch_array($a)){ echo '<option value="'.$b['Section_Name'].'">'.$b['Section_Name'].'</option>'; } echo '</select>'; | |
Re: localhost is different directory from myphpadmin. youre localhost dir is public_html,or if you are using ubuntu you can find it in /var/www | |
Re: have you try [icode] $newfile = 'C:/youre dir/temp.xls'; [/icode] | |
Re: [icode] //link $a = 123; echo '<a href="page.php?id='.$a.'">go to bla</a>'; //page.php?id=123 GET['id'] [/icode] | |
Re: try to open php.ini look for memory_limit then change it.\ youre file is 33554432 bytes = 33MB but youre memory_limit is only 122880 bytes = 12MB try to change memory_limit larger than you're file size | |
Re: [code] if(isset($_POST['Submit'])){ $x = array(); for($i=0;$i<$count;$i++){ $x[$i]['id'] = $_POST['id'][$i]; $x[$i]['name'] = $_POST['name'][$i]; $x[$i]['lastname'] = $_POST['lastname'][$i]; $x[$i]['email'] = $_POST['email'][$i]; $sql1="UPDATE $tbl_name SET name=$x[$i]['name'], lastname=$x[$i]['lastname'], email=$x[$i]['email'] WHERE id=$x[$i]['id']"; } } [/code] | |
Re: [icode] $var4 = "<input type = 'text' name = 'lbl1'>"; $var5 = "<input type = 'text' name = 'lbl2'>"; $element2 = $var4.'<br><br>'.$var5; echo $element2; [/icode] | |
Re: [icode] <?php if(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { //email valid } else { //not valid } //in username u have to make select query to see if user exist in youre database $check = mysql_query("select username from members where username='$_POST[username]'"); if(mysql_num_rows($check)<1){ //username availble } else{ //username taken } ?> [/icode] theres a lot … | |
Re: have you try document.getElementbyId()? you can pass javascript to php by passing value to another element e.g [icode] var content = 'abc'; document.getElementById('a').value = content ; <input type="text" name="a" id="a"> <?php echo $_POST['a']; ?> [/icode] | |
Re: try to [icode] //in submit form print_r($_POST); [/icode] to see if you're post is empty or not. try tomato suggestion, add the type of you're post if its submit,text,radio or whatever | |
![]() | Re: try to print_r($_POST); and [icode] //try to change && into and if(!empty($_POST['vesselname'])&&!empty($_POST['gt'])..... [/icode] ![]() |
| |
Re: if you are only reffering to a white space, you can remove it by [icode] $name = str_replace(' ','',$name); echo $name; //syntax str_replace('the string to be replace','replace with this string',$the variable) [/icode] hope this help | |
| |
Re: just and the site or business name in youre database. then thats the time to make a search engine |
The End.