Jump to content

jackgoddy123

Members
  • Posts

    17
  • Joined

  • Last visited

jackgoddy123's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, I am working on the logic code which returns the values proper as needed combining 1,2,3 arrays. But it gives result as combining first two results as well which is not required. I want if $slice contains "ers" at end so $suffix should not add. for which I have used the regex code. But it prints onlyy array $slice and $array3 in middle of the output as eg: "Biggest Web Development" , "Leading Web Development" , "Best Web Development" as so on after every 9 row. code: <?php $slice = array(0=>"Web Development", 1=>"Online Marketing", 2=>"Australian Web Developers", 3=>"Web Designs", 4=>"Custom Web Design", 5=>"Online Marketing",6=>"Internet Advertising",7=>"Professional Web Design",8=>"Web Designing"); $array3 = array(0=>"Biggest", 1=>"Leading", 2=>"Best", 3=>"Top", 4=>"Largest", 5=>"Premier"); $suffix = array(0=>"Agency", 1=>"Provider", 2=>"Service", 3=>"Specialist", 4=>"Experts", 5=>"Company", 6=>"Business", 7=>"Builder", 8=>"Services"); foreach($slice as $slices =>$value)//keywords { foreach($array3 as $array3_keys =>$array3_value)//superlatives { foreach($suffix as $suffix_keys =>$suffix_value)// suffixs { if((!preg_match("/ers$/",$value, $matches))) { echo $array3_value." ".$value." ".$suffix_value."<br/>"; } } echo $array3_value." ".$value."<br/>"; } } ?> Please help. I am really stuck.
  2. Hello all, Below is the code which I have tried so far and returns the output which I wanted. <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; echo "No files...!!!!!"; echo "<script>alert('No files...!!!!!');window.location.href='upload_file.php';</script>"; } else { $a=$_FILES["file"]["tmp_name"]; $csv_file = $a; if (($getfile = fopen($csv_file, "r")) !== FALSE) { $data = fgetcsv($getfile, 1000, ","); while (($data = fgetcsv($getfile, 1000, ",")) !== FALSE) { //$num = count($data); //echo $num; //for ($c=0; $c < $num; $c++) { $result = $data; $str = implode(",", $result); $slice = explode(",", $str); $col1 = $slice[0]; $col2 = $slice[1]; $col3 = $slice[2]; echo $col1."".$col2."".$col3."<br/>"; } } } ?> But now the case is that the files are been uploaded from .csv file. I want the fetch data from directly "google spread sheet" URL. In the baove code what will be the logic to add the spread sheet URl ? any help is appreciated. Thankyou...!!
  3. Hello, I have a issue to extract csv data with different permutation. Below are the conditions: TO extract csv file,1 row as one sentence To extract csv file data as one row data which has four coulmns combination as one sentence. To extract csv file data as first row column combining with 2nd column of 2nd row(Permutation). eg: I have 4 row with 4 coulmns. After csv data extraction, each row should should form a sentence by combining its 4 column fields. But may be with different permution each rows first coulmn should combine with rest of the 3 rows 2nd columns. A B C D E F G H I J K L So the result should be as: AFCD, AJCD, ABCD and son on. Extracting csv data code is ready all I want to add permutation condition. Any help is appreciated.
  4. Hi all, I am going through a very critical situation where I cannot find bright ideas to work upon. 1. I have an google spread sheet which contains few rows and columns. 2. I want to combine the row together including its column value.(1 row with four columns which results to a single sentence) 3. Simultaneously each row should form a single sentence from the google spread sheet. My spread sheet path: https://docs.google.com/spreadsheets/d/1Z7_oRxlTIiKIND89sAXHbyTsz1mrTMNwejqkfk8y5P0/edit#gid=0 I dont know how to strt of with this and which function, code to prefer ? Any kind of help is appreaciated.
  5. Hello all, I am quite new in the world of css and js So, if some could please help me out with code below. I am working on js toggle effect and it works perfectly fine with icon(image). Below is the code for the same: Since in the above code you can see that i have used images. But the question raised that I need content icon (using font awesome) in-spite of images. Below is the code using font awesome as content images.But it not working fine. If some one could please help me out with this or can give any suggestion.
  6. Hello all, I am quite stuck with the validation part with different requirement in validation. Below is the list which i am working for my application module: a. Form will consist of two input fields (name and email) and a submit button. b. On submit, the validation should check if the fields are empty. c. If any field is empty, the text colour as well as border of the field should turn red. (No need to show an error message) d. When I start typing in the field, The text and border colour should return to default colour. Below is the code which i had tried: <center> <table border="1" > <tr> <td> <form name = "registerationform" method="POST" action="welcome.html" onsubmit="return(regvalidate())"> <table> <tr> <td>First Name: </td> <td><input type = "text" name="fnametxt" /><br/> </td> </tr> <tr> <td>Second Name: </td> <td> <input type = "text" name="snametxt" /><br/></td> </tr> <tr> <td> User Name:</td> <td><input type = "text" name="unametxt" /><br/> </td> </tr> <tr> <td>Email Address: </td> <td> <input type = "text" name="emailtxt" /><br/></td> </tr> </tr> <tr> <td> Password : </td> <td> <input type = "password" name="pwdtxt" /> <br/> </td> </tr> </tr> <tr> <td> Confirm : </td> <td> <input type = "password" name="cpwdtxt" /> <br/> </td> </tr> </table> <font color='red'> <DIV id="une"> </DIV> </font> <input type = "submit" value="Register Now" /> </form> </td> </th> </tr> </table> </tr> </table> </tr> <SCRIPT type="Text/JavaScript"> function regvalidate() { if((document.registerationform.fnametxt.value=="")&&(document.registerationform.snametxt.value=="")) { document.getElementById('une').innerHTML = "First name or Second name should not be empty"; registerationform.fnametxt.focus(); return(false); } if(document.registerationform.unametxt.value=="") { document.getElementById('une').innerHTML = "User name field should not be empty"; registerationform.unametxt.focus(); return(false); } if(document.registerationform.emailtxt.value=="") { document.getElementById('une').innerHTML = "Email id requered"; registerationform.emailtxt.focus(); return(false); } if(document.registerationform.pwdtxt.value=="") { document.getElementById('une').innerHTML = "Please type a password"; registerationform.pwdtxt.focus(); return(false); } if((document.registerationform.pwdtxt.value) != (document.registerationform.cpwdtxt.value)) { document.getElementById('une').innerHTML = "Password Must be equal"; registerationform.pwdtxt.value = ""; registerationform.cpwdtxt.value = ""; registerationform.pwdtxt.focus(); return(false); } else { return(true); } } </SCRIPT> </td> </tr> </table> </center> The above form works for all the fields but i need only two as specified above as well as the textbox border coloring for errors. Really need help. If someone could plese help me out
  7. Hello, I am stuck in one of my application module. I have to set multiple delete option in my application. I have used the below code. The designing is perfectly fine. All what i want to add multiple delete options in it. Below is the code which i have tried out: <html> <head> <title>Strad Hosting Limited -Web Hosting</title> <script language="javascript"> function validate() { var chks = document.getElementsByName('checkbox[]'); var hasChecked = false; for (var i = 0; i < chks.length; i++) { if (chks[i].checked) { hasChecked = true; break; } } if (hasChecked == false) { alert("Please select at least one."); return false; } return true; } </script> </head> <body > <?php $con=mysqli_connect("localhost","stradsol","D#v,b5TnQ!D!","stradsol_sales"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM Persons"); echo "<form name='form1' method='post' action='' onSubmit='return validate();'>"; echo "<table border='1' style=' background-color: white;'> <tr> <th></th> <th>id</th> <th style='padding-left: 11px;'>Lead Generated Date </th> <th>name</th> <th>email</th> <th>contacts</th> <th>requirement</th> <th style='display:none;'>Company name</th> <th style='display:none;'>Address</th> <th>Next Follow-Up date</th> <th>Final_Details</th> <th style='display:none;'>Status</th> <th style='padding-left: 12px; display:none;'>Lead Closed Date</th> <th>EDIT</th> <th>Follow-up History</th> <th>Add Follow-up</th> <th>Delete Record</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td><input name='checkbox[]' type='checkbox' id='checkbox[]' value='".$rows['id']."'></td>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['date'] . "</td>"; echo "<td><a href='config_info.php?id=" . $row['id'] . "'>".$row['name']."</a></td>"; echo "<td>" . $row['email'] . "</td>"; echo "<td>" . $row['contacts'] . "</td>"; echo "<td>" . $row['requirement'] . "</td>"; echo "<td style='display:none;'>" . $row['company_name'] . "</td>"; echo "<td style='display:none;'>" . $row['address'] . "</td>"; echo "<td>" . $row['startdate'] . "</td>"; echo "<td>" . $row['final_details'] . "</td>"; echo "<td style='display:none;'>" . $row['status'] . "</td>"; echo "<td style='display:none;'>" . $row['lead_close'] . "</td>"; echo "<td><a href='edit_eg1.php?id=" . $row['id'] . "'>Edit</a></td>"; echo "<td><a href='Follow_history.php?id=" . $row['id'] . "'>Follow_history</a></td>"; echo "<td><a href='add_follow.php?id=" . $row['id'] . "'>Followup</a></td>"; echo "<td><a href='delete.php?id=" . $row['id'] . "'>Delete</a></td>"; echo "</tr>"; } echo "<tr><td><input name='delete' type='submit' id='delete' value='Delete'></td></tr>"; $count=mysqli_num_rows($result); if(isset($_POST['delete'])){ for($i=0;$i<count($_POST['checkbox']);$i++){ $del_id=$_POST['checkbox'][$i]; $sql = "DELETE FROM Persons WHERE id='$del_id'"; echo $sql; $result2 = mysqli_query($con,$sql); } // if successful redirect to delete_multiple.php if($result2) { echo "<meta http-equiv=\"refresh\" content=\"0;URL=edit_table_del.php\">"; } } mysqli_close($con); echo "</table>"; echo "</form>"; ?> <br><br> <a href="index2.php">[ Back To Home ]</a> </body> </html> I am stuck, the query is not working i thing. Dont know what i am missing. It will be greatful is some one can help me out with this.
  8. Thanx for you reply. I have even google and your reply is perfectly fine. But when i run the above query it results no output. I knw that for "Y" i can get "2014" but when i use it in query its not giving any output. Inside my database i have records with my current date. But unfortunately it fetches no output.
  9. Hello to all, I am updating a dropdown option field. But when i choose "Close" option then a textbox field with the current date appears. Below is the code for it: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script> $(document).ready(function () { $('#status').change(function () { if (this.value == "Close") { $('#Other').show(); } else { $('#Other').hide(); } }); }); </script> </head> <body> <form action="status2.php" method="post"> Status <select id="status" name="status" value="<?=$row['status']?>"> <option>Choose</option> <option value="Open">Open</option> <option value="Inprocess">Inprocess</option> <option value="Close">Close</option> </select> <table> <tr id="Other" style="display: none"> <td> <!-- <input id="txtOthers" type="text" /> --> <label>Lead Close Date : <input type="text" name="lead_close" value="<?php $b = time (); print date("d-m-y",$b) ; ?> " ><br /> </td> </tr> </table> <br/> <input type="submit" value="Update" name="submit"> </form> </body> </html> The above code works perfectly fine. But when i update the records then even the hide textbox(lead_close) gets update. It must only update when the close option gets selected orelse only status with "Open" or "Inprocess" must update. Below is my update code: <?php $konek = mysql_connect("localhost","root","") or die("Cannot connect to server"); mysql_select_db("test",$konek) or die("Cannot connect to the database"); $status= ($_POST['status'])?$_POST['status']:''; $lead_close= ($_POST['lead_close'])?$_POST['lead_close']:''; mysql_query("update public set status='".$status."', lead_close='".$lead_close."' where id='1'"); ?> I dont know where i am missing it. Just need some correction in my code. Thanks in advance.
  10. Hello experts, I am stuck with an query. Actually i want to fetch current date records from my database and the below code probably fetches all my current date records. But it fetches in d/m/y (26/01/14) format but i need in dd/mm/yyyy (26/01/2014) . Below is the code which gives output as d/m/y format: <?php ini_set( "display_errors", 0); $con=mysqli_connect("localhost","root","","test"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $today = date('d-m-y'); $result = mysqli_query($con,"SELECT * FROM Persons WHERE DATE(startdate) = '$today'"); echo "<table border='1'> <tr> <th>id</th> <th>name</th> <th>Startdate</th> <th>Details</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['startdate'] . "</td>"; echo "<td>" . $row['details'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> I tried with the above code and also tried to change the date format i.e : $today = date('d-m-y'); to $today = date('dd-mm-yyyy'); I am not understanding what i am missing. Just need some help in this. Any help is appreciated.
  11. Well..., the code works perfectly fine in Query1.php page. But if i would nt have pasted my link i.e echo "<a href='edit_last_follow.php?id=" . $a . "'>aa</a>"; inspite only : echo "<a href='edit_last_follow.php?id=" . $a . "'></a>"; so how will i get the $a on my next page which is query_1.php page: <?php if(isset($_GET['id'])) $ab= $_GET['id']; echo $ab; ?> I want to echo $a of Query1.php page on query_1.php page. I tried with the code above. I am stuck what i am missing.
  12. I already tried it before but it does'nt work. If i echo the value in Query1.php i get the correct out put. That means the variable value does not pass in query_1.php page. The " get()" is not working there. got stuck there.
  13. Hello experts, I am using a query string code. I want to "get" variable of one page to another page. Query1.php: <?php $konek = mysql_connect("localhost","root","") or die("Cannot connect to server"); mysql_select_db("test",$konek) or die("Cannot connect to the database"); $query = mysql_query("select * from persons where id='1'"); $row = mysql_fetch_array($query); $q= $row['details']; ?> <a href='query_1.php?id=" . $q . "'>aa</a> query_1.php: <?php //$ab=1; //if(isset($_GET['id'])) $ab= $_GET['id']; echo $ab; ?> The above code does not run and give error: Notice: Undefined index: id I am not geting what i am missing. So, can some help me out wid my mistake....
  14. Hello, I have the below code with generate date format calender. It properly works for mm/dd/yy format But i want datepicker in dd/mm/yy format. i.e 24/01/14 (dd/mm/yy) format Can some one help me out. I am quite stuck. Any kind of help is appreciated.
  15. Hello experts, I have created a dropdown list on each click of drop down another drop down list appears from drop1 database. Below is the code of the same: dropdown1.php <html> <head> <script> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","drop2.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <select name="users" onchange="showUser(this.value)"> <option value="">Select a plan:</option> <option value="1">Dedicated</option> <option value="2">VPS</option> </select> </form> <br> <div id="txtHint"><b>Person info will be listed here.</b></div> </body> </html> drop2.php: The above code works perfectly fine for shown the proper dropdown. Now i want to insert the second dropdown value in another database. And i am quite stuck in that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.