Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Everything posted by phpretard

  1. I have a site I am working on that requires a user to login and dowload a file. Is there any way to send myself an alert when the files has been dowloaded. I need to do this so that I can go onto the server and delete the files once downloaded thus saving space... Thank you!
  2. When I am browsing the internet is there any way to find out what session are set in the current browser window?
  3. I have tried this 100 different ways before I posted and can't seem to make it work...
  4. I am trying to include a page based on a session value: [client] => Anthony&#039;s << SESSION VALUE include ("clients/".$_SESSION['client']."/index.php"); << CODE include ("clients/Anthony&#039;s/index.php"); << DOES NOT EXIST include ("clients/Anthony's/index.php"); << DOES EXIST How can I translate &#039; to ' based on the code above. Any Help Today?
  5. varchar(10) // Probably Wrong I know echo $row['enddate']; = 12-15-2008
  6. I am setting a date in my DB with $current_day=date('m-d-Y'); I am looking for a way to check for that day or after and execute code accordingly. The code below does exactly what it should...but I need to somehow say "if $current_day or later" if ($row['enddate']=="$current_day"){ << Problem If Statement $loginMessage="<tr height=30><td colspan='2'><img src='images/exclaim.gif' border='0'> Your 30 Day Trial Period Expired ".$row['enddate']."</td></tr>"; } Thank you!
  7. I am trying to count the number of emails in the array and display a number. $Match should = 3 $Match is only correct in the first table. The second and third adds 3 to each /******* THIS IS THE ARRAY I AM TRYING TO COUNT*******/ Array ( [0] => randal@email.com [1] => membership@email2.com [2] => support@email3.com ) /******* $APPEmail[]=THE ARRAY ABOVE*******/ $result = mysql_query("SELECT * FROM table1 WHERE confirmed2='0' "); while($row = mysql_fetch_array($result)) { $resultSearchAP = mysql_query("SELECT * FROM table2 WHERE APZIPList LIKE '%$PropertyZip%' AND $L1='checked' "); while($row = mysql_fetch_array($resultSearchAP)) { $PoolID=$row['PoolID']; $APPEmail[]=$row['APEmail']; $Match=count($APPEmail); } echo " <table border=0 width='500'> <form action='' method=post> <tr> <td width='130'>Order Number:</td> <td>$ASORDERNUMBER</td> </tr> <tr> <td width='130'>Lender Name:</td> <td>$SendersFirstName $SendersLastName</td> </tr> <tr> <td width='130'>Lender Phone:</td> <td>$lenderPhone</td> </tr> <tr> <td width='130'>Lender Email:</td> <td>$CLEmail</td> </tr> <tr> <td width='130'>Property Zip:</td> <td>$PropertyZip</td> </tr> <tr> <td width='130'>Appraiser Match:</td> <td>$Match</td> </tr> <tr> <td width='130'><input type='hidden' name=ASORDERNUMBER value='$ASORDERNUMBER'</td> <td><input type=submit name='ApproveOrder' value='Confirm And Send'></td> </tr> </form> </table> <br><br> "; } // END SEARCHAP WHILE } // END RESULT WHILE Thank you for looking.
  8. Thank you for your help ... My eyes are bugging out It was the %% ... I knew that . Also...All your criticism is straight up appriciated!
  9. There is no space in the live code. $TheNumber="32775", $resultSearch = mysql_query("SELECT * FROM table WHERE NumberList LIKE '$TheNumber' "); while($row = mysql_fetch_array($resultSearch)) { $id=$row['id']; echo "$id<br>"; //List all the IDs containing $TheNumber. } Thank you for catching that. Any help with the query or "normalizing" the data?
  10. Could you elaborate on ... "normalising your data"?
  11. I have numeric values in a DB seperated by commas (The Field "NumberList" = 32754, 32775, 32780, 32781, 32782, 32783) There are lots of entries that could contain the same numbers and I am searching for those IDs. I am trying to code a quesry to pinpoint one set of those numbers. This is all I could come up with and it isn't working. $The Number="32775", $resultSearch = mysql_query("SELECT * FROM table WHERE NumberList LIKE '$The Number' "); while($row = mysql_fetch_array($resultSearch)) { $id=$row['id']; echo "$id<br>"; //List all the IDs containing $TheNumber. } It seems the LIKE command is definately not the answer. Any help? -Anthony
  12. I keep getting a time out. I have about 80K emails I am trying to assign an md5 to a field called "surveyID" Ideally my DB would look like this in the end if I only had one email. | id | Email | surveyID | 1 me@me.com f620f4647fb816073c9152a284245e64 There are 80K emails All I have is the id and email field so far. I want to assign a md5 for each email. So I am trying to update my database (just the surveyID field with an md5 based on the corresponding email) Here is my screwy code: include ("connect.php"); $result = mysql_query("SELECT * FROM survey_lender WHERE surveyID='' "); $num_rows = mysql_num_rows($result); while($row = mysql_fetch_array($result)) { $ID=$row['id']; $email=$row['Email']; $MD5=md5($email); if ($num_rows >= 0){ mysql_query("UPDATE survey_lender SET surveyID='$MD5' WHERE Email='$email' and id='$ID' "); } } // CLOSE WHILE mysql_close($con); I know someone has the magic code I can't find or figure out. Thanks for your help! Anthony
  13. I am trying to add row values from my database. I am sure this is simple but I am strugling to figure out the code. I have multiple rows named "Question2_1" each with a numeric value. I would like to take all of them and add them together in one query. So if I had 5 rows each with a value of 2 the $total would be 10 Here is what I have. $Question2_1=mysql_query("SELECT * FROM survey_software WHERE Question2_1!=''"); while($row = mysql_fetch_array($Question2_1)) { $totalQ2_1=$row['Question2_1']; echo $total; // <<<<<<<<<<<<<PROBLEM } Thank you
  14. This will handle the breaks the quotes the single quotes... if(isset($_POST['submit'])) { $info=$_REQUEST['info']; $info=stripslashes($_POST['info']); $info=htmlentities($info, ENT_QUOTES); $info=nl2br($info); /** put your insert code here **/ echo $info; /** end your insert code here **/ } ?> <form action='' method=post> <textarea name=info rows="5" cols="36"></textarea> <input type=submit name=submit value=submit> </form>
  15. <? $test=$_POST['test']; if (!$_POST['test']) { $test = "EMPTY"; } echo $test; ?>
  16. I assume shipping details is: 123 Street 2nd Address SomeWhere, ST 12345 I don't have a lot of stars by my name but this is how I handle address info. It makes validation easier also. <? if(isset($_POST['submit'])) { $Street1=$_REQUEST['Street1']; $Street2=$_REQUEST['Street2']; $City=$_REQUEST['City']; $State=$_REQUEST['State']; $Zip=$_REQUEST['Zip']; /** put your insert code here **/ echo $Street1; echo $Street2; echo $City; echo $Zip; /** end your insert code here **/ } ?> <form action='' method=post> <input name='Street1' size=40 /><br /> <input name='Street2' size=40 /><br /> <input name='City' size=20 /><input name='State' size=2/><input name='Zip' size=9 /> <br /><br /> <input type=submit name=submit value=submit> </form>
  17. Can you post your code that is sent after submit?
  18. I am searching my Database with the following query: $result = mysql_query("SELECT DISTINCT Email FROM Emails WHERE Email LIKE '%$list%' ORDER by Email "); Is there a way I can add more diverse searches such as: Right now I can serch everything containing the word "realty". What if I wanted to (in the same query) search for ONLY emails containg "realty" and "bank". How can I adjust this to perform such a serch? The form: <form name='sea' action='' method=post> <input type=text name=list size=30 /> <input type=submit name='GetList' value='search'> </form> Is this question clear? Thanks for your help!
  19. I am importing a CVS file and The import works fine but I can't seem to get rid of the comma just before the email. This is the output: insert into test values (' ', ',email@email.com') < lots of these This is the script: $fcontents = file ("file.cvs"); # expects the csv file to be in the same dir as this script for($i=0; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode("\t", $line); $sql = "insert into test values (' ', '". implode("''", $arr) ."')"; mysql_query($sql); echo $sql ."<br>\n"; if(mysql_error()) { echo mysql_error() ."<br>\n"; } } Can anyone see the problem?
  20. That code worked. Unfortionatly id deleted every ID all 1,677,523 of them
×
×
  • 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.