Jump to content

arturo322

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

arturo322's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How can i import and export my database? i used this code for BACKUP: if (isset($backup)){ $result = shell_exec("C:\\xampp\\mysql\\bin\\mysqldump -u $USER -p $DBUSERPASS $DBNAME > backup.sql"); ..... i always get zero bytes on my sql file. help?
  2. Hi i've encountered the same problem the thing is yes you were right it can read .html files and yes it showed the simple phpinfo(); sourcecode but my source codes seems cannot be parsed my codes works on xampp for linux and xampp for windows but it seems not working when i migrated it to the linux apache mysql php applications here's what i've done apt-get update apt-get install php5 mysql-server apache2 apt-get upgrade modified my php.ini file and changed output_buffering off to output_buffering on because i needed it for most of my sourcecodes i tried restarting the apache2 server by sudo /etc/init.d/apache2 restart still no effect i also tried sudo a2enmod php5 and restarted my server it says php5 running Help please :'( Edit: PS and yes im using ubuntu 10.10 Edit Number2: It seems that it has problems when i include this code conn.php <?php $HOST = "localhost"; $USER = "root"; $DBUSERPASS = ""; $DBNAME= "smsd"; $connect= mysql_connect($HOST,$USER,$DBUSERPASS); if(isset($connect)){ $dbselect = mysql_select_db($DBNAME,$connect); if(isset($dbselect)){} else echo "Invalid Database Name"; }else echo "Cannot Connect to Database"; ?> and on index.php i did include("conn.php");
  3. Little help please? 1. I tried downloading a .txt file on mywebsite but it turned out to be viewing the text file, works on .doc files though 2. Can i have a string variable saved to a file to be downloaded in textfile (.csv) algorith would be like this csv_value = "1,2,3,4,5,6,7,8,9,0"; downloadlink(csv_value,file_name.csv); PS. I used output_buffering = true on my php.ini so i have a little problem if your to suggest to use the header() function. unless there is another loophole. thanks in advance yours truly Art =)
  4. oh, sir what i mean is i want to download the .csv file, but then the problem is the downloaded file that im getting contains html tags of the whole page
  5. Hi i turned my output_buffering to true on my php.ini because i need some of its features for trailing the system my problem now is when im getting .csv file using header function, it seems that it gives me the source code of the interpreted code instead of the expected .csv contents. Here is the source code echo $who; echo $ecrn; $myFile = "($who)$info_value[RecordName]-$ecrn"; header('Content-Type: text/csv; charset=utf-8'); $content = "Content-Disposition: attachment; filename=".$myFile.".csv"; header($content); $output = fopen('php://output', 'w'); $sql = "SELECT * FROM classrecordvalue"; $query = mysql_query($sql); // loop over the rows, outputting them while ($row = mysql_fetch_array($rows)) fputcsv($output, $row); im just wondering does output_buffering true in php.ini affect the output here? if so any other suggestions there of how i can download .csv files using php? thank you much for the people who will help
  6. or perhaps how i can make libssh work for lampp ubuntu10.10
  7. Hi im Art, Im trying to make use of Shell_exec() function to execute gammu(smsgateway for linux<CLI>) to text a message using my php page. This is my actual code: <html> <form method="POST"> Message: <textarea name=Message></textarea> Number: <input type=Text name=Number> <Input type=Submit name=Send value=Send> </form> </html> <?php extract($_POST); if (isset($Send)){ $output = shell_exec("pwd"); echo $output."<br>"; $cmd="gammu --identify"; echo $cmd."<br>"; $output = shell_exec($cmd); echo $output; $cmd="echo '".$Message."'|gammu sendsms TEXT ".$Number; echo $cmd."<br>"; $output = shell_exec($cmd); echo $output; } ?> But this is the error: /opt/lampp/htdocs gammu --identify Error opening device, you don't have permissions. echo 'Hi There'|gammu sendsms TEXT +639270000000 Error opening device, you don't have permissions. PS: It works well if just issue the command echo 'Hi There'|gammu sendsms TEXT +639270000000 on my terminal but i dont know why it doesnt work for php, and another thing, i wasnt using any sudo commands on shell i just type the command directly, hope someone can help me out thanks
  8. this was the url http://localhost/prototype/index.php?go=2 This is my actual code but it seems my code does the action twice and not only on if (go=2) statement and, there were no strings inserted on the database <?php $who = $_SESSION['who']; //$sql = "select s.scode,pl.section from subj s,pload pl where pl.scode=s.scode && pl.pid=$who"; $sql = "select s.sname,pl.plid,pl.section from subj s,pload pl where pl.scode=s.scode && pl.pid=$who"; $myquery = mysql_query($sql); $count_rows = mysql_num_rows($myquery); for($x=0;$x<$count_rows;$x++){ $fetch_value = mysql_fetch_array($myquery); //echo "<tr>$fetch_value[scode] - $fetch_value[section]</tr>"; echo "<th><a href=?go=$fetch_value[plid]>$fetch_value[sname] - $fetch_value[section]</a></th> "; } ?> <?php extract($_GET); if (isset($go)){ $sql = "select s.scode,s.sname,pl.section from subj s,pload pl where pl.scode=s.scode && pl.pid=$who"; $myquery = mysql_query($sql); $count_rows = mysql_num_rows($myquery); for($x=0;$x<$count_rows;$x++){ $fetch_value = mysql_fetch_array($myquery); if ($go = $fetch_value[scode]){ $field[0] = "Student Name"; $field[1] = "fail"; $field_ser = serialize($field); print_r($field_ser); //$field_unser = unserialize($field_ser); //print_r($field_unser); echo $filed_ser; $sql = "update pload set classrecfield='$field_ser' where plid='$go' && pid='who'"; mysql_query($sql); } } }
  9. oh so my syntax is correct but how can i store the string on a variable? so that i can store it on my database?
  10. i tried to serialize an array in php but im not sure if i had the right syntax $field[0] = "Student Name"; $field[1] = "fail"; $field_ser = serialize($field); $field_unser = unserialize($field_ser); i think i didnt do it right
  11. Thank you for the reply. maybe ill go for the gateways any gateways easy to use you can suggest? can i process recieved messages if ever i use sms gateways? :-\
  12. is there a function that can send text messages using php? thru an sms modem?
  13. Can this send and recieve SMS messages? it works like this, Cellphone users texts command to simcard on sms modem, the sms modem recieves the data and processes the command, after processing sms modem sends response to the cellphone user
  14. i would like to send sms using AT Hayes command in php... is it possible?
  15. Hi, We are currently making our thesis and part of it is make use of AT Hayes command, which i executed on hyper terminal. first you need to configure the port where your modem is connected, on my case its connected on com4, after configuring the ports you can now execute at hayes commands on the hyper terminal. i would like to ask if is it possible to execute at hayes commands using php to send and recieve messages form cellphone and file it on database
×
×
  • 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.