Jump to content

greatchap

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

greatchap's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All I need to do was add this line -> mysqli_set_charset($con, "utf8"); Thank you for your help
  2. Sometimes output is blank and sometimes its some JSON error. For e.g. see this text : NIFTY AS A DAY OF REST, GOES THROUGH AN INTRADAY CORRECTION, MARKETS REMAIN CHEERFUL – BUY ON DIPS If I do not change the "-" to something else the output is null/blank. My table are normal MyISAM engine MYSQL tables and field type is varchar.
  3. Hello Everyone, I have a PHP code that reads data from db table. Then it converts it into JSON and show it. However if data table field has - or so then it gives json error. For e.g. if($num > 0){ while($res = mysqli_fetch_array($query)){ $NDate = $res['NDate']; $Summary = substr($res['Summary'],0,256); /* CREATE ARRAY FOR SHORT TERM NEWSLETTER */ $newsletters[]=array('newsletter'=>array("RecID"=>$SNo,"Summary"=>$Summary)); } /* JSON OUTPUT*/ $json = array("AuthOK" => 'True',"newsletters"=>$newsletters); header('Content-type: application/json'); echo json_encode($json); How to solve the issue ? Regards, GR
  4. Hello Guys, The SMS vendor gave me php code which working using cURL. I tried and it did the job. Thank for your help. Cheers, GR
  5. Hi Guys, I have a Url which allows me to send sms to a number. The url usually asks for id , number and few other things. When I paste the url in browser and press enter it opens and a sms is sent. Now I want to code in php a way to send sms without redirecting to that page. For e.g. I ask user his mobile number and then I should be able to call/run that url and a sms should be sent to his number. If I use php header then it redirects to that page. I have tried using file_get_contents and php cURL but it has not worked so far. Can you guys help me out ? Thank you, Cheers, GR
  6. Alert command for javascript does the work. But rather than displaying a typical message box is it possible to show a better dialog box either using some other tool.
  7. Hello Guys, I am not a php or web developer. I need to do some work in a login php script and I know just enough php to do that. Basically I am in a function where I get some data entered by user. I need to validate that and if there is a problem tell the user what it is. One option is to use javascript and use the alert command to show a message box. I want a slightly better option. Something like showing a dialog box form/box with text and an ok button. Can you guys give me a function which takes 2 inputs like title and text and does the job. for e.g. ShowMessage("Title","How are you?"); // and this does the job. Thank you, Cheers, GR
  8. Ya I do put in session start at the begining of every page. otherwise the index page inside wordpress would have not opened in the first place. Kinda weird as to why its happening. By the way how can I use php to access a protected folder.
  9. Hi Guys, I am developer and relatively new to php although I have written a few scripts. I have a site which runs on linux/unix platform. I am facing a weird problem: - I have a php script (e.g. site.com/test/test.php) which takes a input from url, and creates a session and opens a wordpress php in another folder (e.g. site.com/wp/index.php) - I wrote a small php code in that wp/index.php which checks if session exists or not. if yes, then no problem, if not then die and show a message. Now the problem is when I run the script, it opens the wp/index.php and the page opens. Good. But when I click on any link in that page e.g about or so, then I get message which I wrote that session not found and so on... I don't know why this is happening. So if you guys can help me with this it would be great. Alternatively, I thought if I protect the wp folder (using protect folder thru cpanel) and write a php script outside which call the php inside the wp folder with a hardcoded uname & pw, then i can run the php inside without anyone knowing what the actual uname or pw is. This way if a user directly tries to access it , he wont be able to do so as uname & password box will appear. But I dunno how to call a php inside protected folder. I tried to redirect but the uname & pw box appeared. I would be grateful if anyone can help me. Thanks a lot, Cheers, GR
×
×
  • 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.