Jump to content

funstein

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by funstein

  1. I have got to say, I understand nothing. Can you help a little more?
  2. I haven't actually found out anything but the fact that "." doesnt work. I am an alien to this, tbh.
  3. Hello everyone, I am looking for a regex that will return any data that is enclosed with quote marks ("). So, when given this string : "String1" "String2" It should return an array that is 1 -> String1 and 2-> String2 Thanks..
  4. Oh, I really am sorry My browser didn't display the iframe scroll bar Thanks for everything!
  5. I'm getting an HTML input from Google Spreadsheets Visualizations. It's a pretty simple one actually. I get the data using file_get_contents().
  6. OK, I see. But can you point out how I can import the HTML and get an array of <tr> tags? Thanks
  7. I seriously sound like a n00b here xyph, but what I meant by it doesn't work was actually it returns associative arrays. I have no idea about why that is happening, all I know is that it should be returning an array that has the first match as $array[0] and the second one as $array[1] and it doesn't. And silkfire, what does that do, and how do I run a regex on that?
  8. I tried, for some reason it wont work and it says Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '<' in C:\blabla\test.php on line 7 And not all <tr> tags are on new lines. Can you please send me another working one?
  9. I have <tr> tags that contain extra attributes, like <tr style=blabla>, and </tr> tags. I want to make PHP grab the data in between. Please check the example. The Data : <tr style="font-weight: bold; background-color: #aaa;"> <td>School</td><td>Position</td><td>Name</td><td>Surname</td><td>Delegation</td><td>Commitee</td> </tr> <tr style="font-weight: bold; background-color: #aaa;"> <td>School1</td><td>Position1</td><td>Name1</td><td>Surname1</td><td>Delegation1</td><td>Commitee1</td> </tr> It should return me with these : $array[0] will be <td>School</td><td>Position</td><td>Name</td><td>Surname</td><td>Delegation</td><td>Commitee</td> $array[1] will be <td>School1</td><td>Position1</td><td>Name1</td><td>Surname1</td><td>Delegation1</td><td>Commitee1</td>
  10. the thing is, it gets a 404 error from your host. Which means you typed one of the redirections or the form actions wrong.
  11. strtotime("next Thursday"); That should do it.
  12. You could use the division(/) and operator like this : function convertSecondsToMinutes($amountofseconds){ $minutes = $amountofseconds / 60 ; $minutes = floor($minutes) ; $seconds = $minutes * 60 ; $seconds = $amountofseconds - $seconds ; $return = "$minutes minutes and $seconds seconds." ; return $return ; } Wanna test it ? Visit the link : http://codepad.org/IXHMDqNr
  13. Hello, I am developing an account manager for our local network and I want people to be able to login to my website and change their UNIX & Mailbox password. These people have SSH access so that is why the UNIX passwd should also be changed. So what I want to do is get the values $username, $currentpwd , $newpwd and $newpwdcnfrm from the HTML form and execute the following shell commands : The problem here is, passwd takes old and new passwords as input, not as command parameters. So I cant just do shell_exec("passwd $currentpwd $newpwd $newpwdcnfrm") ; Do you guys know how to give input to the command? Thx. Btw : Please do not argue about the security issues. I am aware of everything and I am perfectly sure that the script will run securely.
  14. Hello there, I have a script that has two variables called oc_id and oc_pos. These variables, oc_pos and oc_id, are summoned from a database based on user input. Sometimes it is 120, sometimes 50, sometimes 5. So the number of digits varies. Now I need to convert these into an identifier string for some purpose. But I want them to be 3 digits always, for example, 120, 050, 005. How is that possible?
  15. I can send you the whole code, if you want.
  16. Check the photo, you can see that on some rows, the TYPE value is not defined.
  17. There is no other way of insertion to the table. I have sent the code to you by PM, you can see that there is a validation, it kicks back if the field is null, and as the field is checkboxes, people have to select either regular,reduced or student. Or it kicks them back to the form and tells them to pick one.
  18. How I know that is, I have submitted the form with different information 1000s of times and never ended up with a blank. I have no idea how these people manage to do that.
  19. I havent done any of these, because I cant simulate the error, I dont know why. None of my queries end up empty in the database. I'd start echoing variables but it wont help a lot since my queries are OK. I'm sending you the source code now, with MySQL information blanked.
  20. I have tried lots of different ways and I havent been able to come across this problem myself. Do you think you can help if I send you the whole code? Because this is overwhelming and I am going to be stuck with lots of untagged information if this goes on.
  21. Hello everyone, I am working on the registration script of an academic conference. In the form, there are 3 registration types, which are to Regular, Student, Reduced. If the person has checked student, the script checks if his paper is listed as a student, and if they choose Reduced, the scripts check if their country is in the array of reduced countries. Then, the type is inserted into mysql alongside other information. So here is the problem : I see blanks in phpMyAdmin. All other fields are OK while this one is not. Here is the code : (All variables are defined correctly, only parts related to the problem are here. MySQL connection is OK.) //check if fee conditions are met if($formtype == "student") { if($check['student'] == "T") { $warning['studentwarning'] = false ; $type = "Student" ; } else{ $warning['studentwarning'] = true ; $type = "Regular" ; } } elseif($formtype == "reduced") { if(in_array($country, $reducedcountries)) { $warning['reducedwarning'] = false ; $type = "Reduced" ; } else{ $warning['reducedwarning'] = true ; $type = "Regular" ; } } else { $type == "Regular" ; } $type = mysql_real_escape_string($type); mysql_query("INSERT INTO registration (type) VALUES('$type') ") or die(mysql_error()); Hope someone can help me. Thanks, Funstein
×
×
  • 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.