Working Connection... Not Working? (Advanced)
It has tons of modules, and obviously a config file which opens the db connection. But there is one, and only one, module having strange troubles.
$query is just a simple INSERT INTO command. But it does not inserts anything. I only obtain... nothing. Neither an error from the server! Code:
View Complete Forum Thread with Replies
Related Forum Messages:
SSL Curl Connection Not Working
I'm trying this SSL curl connection without success: <?php header('Content-Type: text/xml'); $url=urlencode("https://www.one-server.com/one-cgi.cgi"); $request="<request><plaintext>1111222233334444</plaintext></request>"; $ch = curl_init(); $res= curl_setopt ($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , true); curl_setopt($ch, CURLOPT_PORT, 443); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec ($ch); curl_close ($ch); print_r($response); ?> The error I get is : "Error de lectura XML: no se encuentra elemento .....
View Replies !
Connection To MSSQL Server Has Stopped Working
I made all the necessary changes to my server (windows 2k3 r2) in order to get my php page to read from my MS SQL (v6.5) server (on another machine). I was able to pull data down last night with no problem. Today, however, I get nothing. The server I'm pulling from is up and has no errors. If I change the login/password for the connection string to something wrong, I don't get an error message. In fact, the page is blank as if there was an error within the code (this is regardless of whether I use a correct or incorrect login). Yesterday when it was working, if I used the wrong login, I got the usual error message back. If I comment out all the lines regarding the connection, it builds the table just fine. I've attached my code below (stripped out some table columns and data manipulation code). I have copied ntwlibd.dll to my windowssystem32 directory and enabled the "extension=php_mssql.dll" line in my php.ini file. If anyone has seen this before or has any suggestions, please let me know... this is quite frustrating. <?php $con = mssql_connect('server', 'login', 'password'); if (!$con) { die('Could not connect: ' . mssql_error()); } mssql_select_db("CM", $con); $sql="SELECT *FROM Private_Build"; $result = mssql_query($sql); echo "<table border=Ƈ'> <tr> <COL width=ï`'> <th bgcolor='black' style ='color:white'>Patch ID</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Packages'] . "</td>"; echo "</tr>"; } echo "</table>"; mssql_close($con); ?>
View Replies !
Connection To Mysql Working In Eclipse But Not On Apache?
I have installed apache, php5 and mysql on my laptop. I write my code in eclipse and when I test it inside eclipse, the mysql database connection is working, I can execute the script inside eclipse. But when I put that same script into my htdocs on the apache server running on the same laptop and access it using my browser, I get a "Call to undefined function mysql_connect()" error message.
View Replies !
Advanced: + HTTP/1.1 + Keeping Connection Alive
I need to maintain the connection between my PHP5 script and the client alive. A client issues a HEAD request. I answer back to the client with several HTTP headers, such as Conten-type of what the client would want, Content-length, etc. Without closing the connection the client will then respond with a GET request, to try to obtain a part of the file. Then I need to respond with 206 Partial content, and deliver the chunk of the file the client wants. My problem is, everything I've ever done in PHP has been only answering, the pages never listen to a response from the client, only to requests. Code:
View Replies !
Sessions Working, Then Not Working?
I wrote a login script (one that I have used on quite a few sites previously) and have found that it was working, then not working, then working again now not working - all without me changing any code. Here is the process: 1) l/p gets sent to login.php to query the db 2) if login successful, set $sid = session_id, and other session variables, register them in the session, and redirect to main.php 3) first thing on main.php is check_login function, all this does is see if $sid is set and equal to the current session_id(). If succeed continue to display data on main.php based on registered user data. If fail, redirect to error.php with the appropriate error code. this all takes place on a shared ssl server if that matters. The trouble I'm having is the check_login function is failing because no session variables are present, including $sid. I'm 99.9 percent certain it's not a code issue because 1) I have done this same script many times before with no trouble, and 2) this particular one was working before So I am really looking for php configuration issues to check on, or things like that.
View Replies !
Working On CMS
I want to start customizing open source CMSs. But I could not understand how to start. Can anyone help me on this regard?
View Replies !
PHP Working With IIS 5
I have been trying to get PHP working with IIS 5.0 Server 2K for days now with no luck. I have searched everywhere I can think of for examples.
View Replies !
Need Help Getting Php Working
I have an apache 2.0.55 w/ php 4.4 on gentoo. When I browse to my url, all it shows is a directory listing so I don't think I have php properly installed because it doesn't seem to be processing my php pages. In my /etc/apache2/httpd.conf file I have a line ... Include /etc/apache2/modules.d/*.conf and I have an /etc/apach2/modules.d/70_mod_php.conf file which contains ... ----- <IfDefine PHP4> # Load the module first <IfModule !sapi_apache2.c> LoadModule php4_module modules/libphp4.so </IfModule> # Set it to handle the files <IfModule mod_mime.c> AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php4 AddType application/x-httpd-php-source .phps </IfModule> AddDirectoryIndex index.php index.phtml </IfDefine>
View Replies !
Why Is Which Not Working?
I uploaded the following file to my site: <?php header("Content-type: text/plain"); echo "latex is at: "; system("which latex"); echo "ls is at: "; system("which ls"); echo "convert is at: "; system("which convert"); echo "gs is at: "; system("which gs"); ?>
View Replies !
Php Not Working
My php file that I have written doesnt seem to be working..just displays a blank page. If i write out a test file (test.php) and put it in the same directory and type this in it <? phpinfo(); ?>, the test file works.... Does anyone know what could be wrong... the file is about 1100 lines of code... I am running Apache 2.0.50 with php 5.0.5 on windows platform.. to my knowledge have have closed all my brackets correctly...
View Replies !
PHP Not Working On SSL
I uploaded some php based software of mine onto a secure server (SSL) and it used to work locally and on a non secure server although it doesn't seem to want to work on the SSL. I can login which works but when i get greeted with the admin page none of the links work?? I've tried includingthe php itself but nothing.. I've no idea why it doesn't work with a SSL server. In the address bar, if i delete the 's' from 'https' the page loads further but still doesn't load because the next page will also begin with https. Code:
View Replies !
<? Tag Not Working..
i had updated my PHP to 5.2 and my <? tag is not working , it was working before. There are lot of pages so making <? to <?php got time consuming and i changed the setting in php.ini file short_open_tag = on it was off and i changed it to on but it is still not working, i restarted my apache and my pc too, but it still does not work,
View Replies !
If Else Not Working
<?php if ($_GET['p'] = board){ flights(); }else{ echo 'not board'; } ?> When ever I load the page, be it ?p=board or anything else, flights() is activated (stored on other file).
View Replies !
MAX() Not Working
correct me if im wrong but isnt MAX() ment to retrieve the highest record from the specified column because mine isnt in my column i have the highest set to 16 and its pulling the highest as 4?
View Replies !
BCC Working
When I add a $bcc to my code, that part works, but the $to stops working. Code: <?php $to = $_POST['send_to']; $bcc = "me@mysite.com" $subject = "Subject"; $headers = "From: " . $_POST["name"] ."> "; $headers .= "Reply-To: " . $_POST["email"] . " "; $headers .= "Return-path: " . $_POST["email"]; $message = " From: " . $_POST["name"] ." E-mail: ". $_POST["email"] . " Message:" . $_POST["message"] ." Click Here: http://www.mysite.com";...
View Replies !
PHP Del Not Working
I found this script and everything was working fine. But since I have set it up for multipul users. Now the delete function won't work. Code:
View Replies !
Css Not Working Together
I am having some minor issues which i know how to fix but it is not how i want to do it. This is how i am doing my php for my website, I have 3 small template and the first on is header, second is right content, and the last is footer. In my header is obviously the css the meta tag and so on. OH yea one more thing i am using the include php tag. 1) First off, my css is not matching with the entire site, I don't want to use the full url like http://.... I want the exact ../style/css (like that). How can i do that? 2) Lastly, my main pages go to the other pages but not itself. So if you go to the home page click on home navigation button it will not find it. I don't want the absolute links like the first issue I want to be able to use relative links. How can i do that?
View Replies !
Something Not Working
I have this SQL on my page: PHP Code: SELECT * FROM ipals_members LEFT JOIN ipals_main_img ON ipals_members.m_id = ipals_main_img.m_id WHERE m_age >= '$agefrom' AND m_age <= '$ageto' GROUP BY ipals_members.m_id and i have the users name, country, age and profile image displayed. I have 2 members set up right now just for testing. Its showing the first member fine. Info and the image. BUT. the next user is having their info shown, and the NO IMAGE in place of the photo as there hasnt been an image uploaded. But when you hover over the [View Profile] link. User A, has their user number show which will pull up all their info ect. But user B has an empty ?member_id. its getting all the info including the member_id if i add a photo. But thats not good for those who might not want to add a photo.
View Replies !
Working With Md5
I am trying to make a user login with md5. I don't know much about it and how to incorporate md5 all that great but I have my speculations and some hint from reading on the web. So I know that you have to have a field for the password to be 32 bits long but this is what I am guessing and If someone can tell me that this is right or not that woul dbe great. When a user submits a password it gets hashed and then that hash is compared to their password hash that is stored in the db and if they match up then they can proceed to the user's homepage.
View Replies !
GD Not Working
I wanted to have a code to get a image resize it and then show it like this <img src="resizescript.php?picture_id=23"> But GD Lib does not work... can this now be done with something like flash?
View Replies !
Or Die Isn't Working.
can anyone see why this "or die" statement at the end isn't working when someone enters a name that isn't found? Right now if you put in a name that isn't in the database, the page just returns blank. And I would like an error to appear. <?php $con = mysql_connect("mysql","test","password") OR die('Could not connect: ' . mysql_error()); mysql_select_db("test", $con) OR die(mysql_error()); if(!$_POST){?><form action="" method="post> <input type="text" size="12" name="name" value="<?=$_POST['name'] ?>" /> <input type="submit" style="width:107px" value="Check name" /></form><?} else{$modify = mysql_real_escape_string($_POST['name']); $query = "SELECT name FROM checkname WHERE name = '$modify'"; $result = mysql_query($query) or die('Error in name.' . mysql_error()); The just above "or die," error after the query, won't appear, when a name in the database isn't found. Need to fix it.
View Replies !
Log On Not Working.
I am trying to get a log on script up. so far I have successfully added the user to the database and i see it in my sql admin thing and everything. when I go to log on, nothing happens. it does the same thing weather the name is right or wrong. Code:
View Replies !
IF... ELSE Not Working
i got this code <?php if ($user_sel_date>=$mycurrentdate) { if ($from>=$my_current_time) { ?> <form name="time" method="post"> <table width="300px" border="0" cellspacing="0" cellpadding="0"> <tr> Other form elements here </tr> </table> </table> </form> <? }
View Replies !
LIKE Not Working
im having problems with a LIKE it simply returns no results on 'a%' searches when the results are there. example: SELECT * FROM table WHERE field LIKE 'a%' Returns 0 <== SELECT * FROM table WHERE field LIKE '%a%' Returns 1 SELECT * FROM table WHERE field LIKE '%a' Returns 1 field = aba im not sure if its to do with collation.
View Replies !
Can't Seem To Get It Working
I am trying to place an include file in the statement below: --------------- echo <<<End <tr><td >blah blah</td></tr> <? include("include-file.php");?> <tr><td >blah blah</td></tr> <table> End; $script = $_SERVER['PHP_SELF']; echo <<<End <form action="$script" method="POST"> End; ---------------
View Replies !
Working Up To PHP
I am working my way up to PHP. I know some forms in HTML, and that is as far as in am in HTML. I am trying to start on Javascript, but all of the variables are confusing the hell out of me.
View Replies !
$GET Is Working
I have a strange problem with POST form action. I've built a site in PHP5 on Windows and it's working fine. I then ported it to my Linux Fedora Core 4 box also running PHP5. Now I can't even log in. I've determined that when I change the form action to GET, I can pass on to the script that validates the user, but not with POST? All it does is refreshes the page.
View Replies !
POST Not Working...
hello. im running php/mysql/apache on linux, os x and freebsd. on os x, everything works fine, but on linux and freebsd the default install of 4.2.3 does not accept POST....i dont know how to explain but when i submit a form, the data wont be changed to variables. i checked the ./configure --help file but there was no option...i just assumed it was built in...anyways thanks for any help.
View Replies !
Superglobals Not Working On IIS
GRR.. i really don't like microsoft.. I am stuck working on a Win 2K/ IIS 5 server. I have installed PHP 4.2.3 and it runs fine. BUT.. none of the superglobal arrays seem to be available. The scripts I wrote were on a Linux/Apache set-up, and relied on register_globals being on, but I have changed it so now I am using the superglobal arrays. My first script has a session_start, and session_register for a var called office_query. On the next page, I have a session_start but $_SESSION["office_query"] is not set??? Sessions are being created... in the session data folder, there are all the files with office_query|s:375|blah blah in them.. but they don't seem to be readable or aren't being read. I have tried playing with register_globals, and use_tran_sid.. to no avail. I am totally out of ideas.. could anyone give me some pointers? ideas? a place to start?? even better.. tell me how to fix this?
View Replies !
Strpos Working On/off
Small problem here with some code I have written to list some links. Basically, It grabs categories from the database and then for each category, it lists all the links. It should give an icon to each link depending on the type. It gives www.gif to links that are not sorted by the following rules. ftp.gif for any link containing 'ftp://' local.gif for any link to something on the local servers (all have .168' at the start of the IPs) Problem is though, the ftp one doesnt seem to work. I have entered many test links to the database but it doesn't seem to pickup the ftp links (ex. ftp://ftp.somesite.com or ftp://domain.com). Anyone help me with this here as its stopping me from handing this stage in.
View Replies !
Chop() Not Working?
I have a string in $values, with some comma separated values, such as: $values = "value1, value2, value3"; With this function i want to create an array containing this values: function createArray($string) { // remove spaces $string = chop ($string); // explode string into array $valuesArray = explode (",", $string); return $valuesArray; } $myArray = createArray($values); the problem is that chop() does not remove spaces and i get an array of values containg white spaces. Am i using the wrong function? Or what? (PHP version on my server is 3.0.16)
View Replies !
Cookie Not Working
I have a script which handles info coming from a html form. I wish to stop multiple submissions by making the user wait 60 seconds before its possible to re-submit. I have this working correctly in one script but the identical code pasted into another script no longer works. PHP Code:
View Replies !
Sessions Not Working In AOL
This is odd. I am writing a simple user tracking thang which will enable a user to have access to forms if a session is registered for them. Here is the weird part. In aol, a session is registered, but the value doesnt exist. Like it recognizes that session_is_registered("variable") but it wont hold on to the value of $variable. I am using this variable to access a database, in which I am pulling info from their profile and prepopulating boxes for a form, but since the value doesnt work, the form is empty, and thus screws up the process of collecting the proper form data. It works perfectly in IE, and Netscape, this is why I am totally confused. Would AOL not set cookies, lets say, for the session ID? Has anyone had the same experience?
View Replies !
Mysql_fetch_array Is Not Working?
can anyone tell me why this does not work? obviously there is more to the script but i believe that this is where my problem is, $result = mysql_query("SELECT * FROM table WHERE field LIKE 'variable'"); $result2 = mysql_query("SELECT * FROM table WHERE field BETWEEN 'variable' AND 'variable'"); while($r=mysql_fetch_array($result,$result2))
View Replies !
Mysqldump Not Working
My hosting provider claims that this script worked when they ran it manually. They also mentioned that they had to remove some whitespace to get it to work. I cannot see any problem with the script now, but it still does not work when called directly from a browser. The script and the folder it is writing to are chmod'ed to 755: <?php $cmd1 = "/usr/bin/mysqldump -hsome.server.net -uusername -ppassword --all-databases > /home4/sub002/sc11883-LGVN/www/Backups/a.sql"; system($cmd1); echo "Done"; ?>
View Replies !
Php5 Not Working
I recently upgraded to php 5 and nothing seems to be working properly. Errors are not being displayed even with error_reporting(E_ALL). Whenever the parser finds something it does not like, a blank page is displayed. Furthermore, even a simple include "file.php" does not work. No error, no included file. Nada. However, php is installed and "working". echo "hello" does work.
View Replies !
Form Not Working
My form Is not doing what it is supposed to do. It just keep recycling itself everytime i push the submit button. PHP Code:
View Replies !
Extension_dir Not Working
I'm using PHP 4.3.1 on IIS6 and I'm trying to get GD2 to work ... I've modified PHP.ini (extension_dir= c:phpextension + removed the ;) but the only result is that php refuses to work after that. I've tried extension_dir = "c:phpextension" / extension_dir = 'c:phpextension' / extension_dir = c:phpextension / extension_dir = ../ extension_dir = "./" / extension_dir = './' and I've even tried copying the dll to c:windowssystem and c:windowssystem32 but none of them work ...
View Replies !
Working With Upload_max_filesize In Php.ini
I'm writing a file upload class and I'm trying to be as intelligent about it as possible. (i.e. good, clean code). My class has presently has a var called $_max_filesize var and if the user's file is larger than this, I say 'sod off.' Here's my question, can I find a way of setting this $_max_filesize to the value in the php.ini file ('upload_max_filesize') easily and reliably? (so it can never be exceeded) I am familiar with ini_get('***') but that returns the exact string that's present in the .ini file. Default is ƈM' but what other values can it take on? (i.e. how woud it specify bytes, kilobytes, etc...if there is no letter/descriptive term after the number, what is it considered to be?) I'm attempting to code for portability here and assume that it won't always be 2M or some other *M value. I appreciate any and all help. I've looked quite extensively on this forum and only found a few deadends. If someone knows or can point me to the direction of all the allowed quantifiers ('M', etc).
View Replies !
Php Upload Not Working !
I cant get a file to upload on my local machine running apache and php (both are installed and configured correctly). My form looks as follows, the hidden input is so the php section is only ran after the form is submitted - Code:
View Replies !
Imagecopyresampled Not Working
I'm trying to create thumbnails of PNG images. I have code that used to work but doesn't seem to anymore. The resizing just seems to return black images, even though my source image is not black. Anyone know what could be the problem? Here's my code:
View Replies !
Exec Is Not Working Right
I'm trying to convert a video with exec i have just installed php 5.0.5 on my server and every thing seems to work except exec can you help i have tried <? runExternal( "ffmpeg -i video.mov -s 320x240 -r 30 video.flv", &$code ); if( $code ) echo "bad transcoding"; else echo "looks good"; function runExternal( $cmd, &$code ) { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a file to write to ); $pipes= array(); $process = proc_open($cmd, $descriptorspec, $pipes); $output= ""; if (!is_resource($process)) return false; #close child's input imidiately fclose($pipes[0]); stream_set_blocking($pipes,false); stream_set_blocking($pipes[2],false); $todo= array($pipes[1],$pipes[2]); while( true ) { $read= array(); if(!feof($pipes[1]) ) $read[]= $pipes[1]; if(!feof($pipes[2]) ) $read[]= $pipes[2]; if (!$read) break; $ready= stream_select($read, $write=NULL, $ex= NULL, 2); if ($ready === false) { break; #should never happen - something died } foreach ($read as $r) { $s= fread($r,1024); $output.= $s; } } fclose($pipes[1]); fclose($pipes[2]); $code= proc_close($process); return $output; } ?> and <? exec("ffmpeg -i video.mov -s 320x240 -r 30 video.flv"); ?> and <? system("ffmpeg -i video.mov -s 320x240 -r 30 video.flv"); ?> None worked ....
View Replies !
Random $var Not Working.
I wrote a script to display a list of random different words, each on a seperate line, from text file but it seems everytime I call the $var its the same word... Here is the script: $wordlist = file("http://$HTTP_SERVER_VARS[HTTP_HOST]/wordlist.txt"); $num_rows = sizeof($wordlist); $word = $wordlist[rand(0, $num_rows - 1)]; Now when I try to display 5 random words at different parts of my page they are randomized per page load but not indvidually. Ex: <?php echo $word;?> <?php echo $word;?> <?php echo $word;?> <?php echo $word;?> <?php echo $word;?> Displays: word23 word23 word23 word23 word23 what I'm tryin to do is have it display: word11 word55 word8 word21 word14
View Replies !
PEAR Doesn't Seem To Be Working
I installed PHP with PEAR support on my Windows computer. I tried the snippet of the book "Learning PHP5": <?php error_reporting(E_ERROR | E_WARNING | E_PARSE); echo "test"; include 'DB.php' $db = DB::connect('mysql://penguin:top^hat@db.example.com/restaurant'); if (DB::isError($db)) { die("Can't connect: " . $db->getMessage( )); } ?> But it only prints "test", it should display an error message saying it's not able to connect to the DB. Do you know why nothing happens? Also, I think there should be a real "DB.php" file, correct? What should I put into this file? Or is it only a line "as is", that doesn't mean there needs a "DB.php" file?
View Replies !
Why Is Ftp_get Not Working?
Are there any precautions that I should take when downloading a file from a remote file on Linux platform to a local file in Win98 platform? I am using the method ftp_get $remotefile = '../products.txt' $localfile = 'C:/data/products.txt' ftp_get($conn, $localfile, $remotefile, FTP_ASCII))....
View Replies !
Mysql_select_db() Not Working
I've recently transferred some PHP scripts from my local webserver to the server of some web hosting that I now have. However, the scripts no longer work. I have traced the problem to the mysql_select_db() function which is failing to select the database. This is the start of the PHP script: <?php $db = mysql_connect("localhost", "scos_root", "root"); echo "db = ".$db."<BR>"; mysql_select_db("scos_DB", $db) or die("Could not select database:".mysql_error()."<BR>"); ... I created a database called scos_DB and a user called scos_root with password root. However the above script gives the following output: db = Resource id #2 Could not select database:Access denied for user: 'scos_root@localhost' to database 'scos_DB' I'm sure that this just some kind of teething problem that I'm having as the scripts are now running in a different location but I just can't see what it is - anyone else have similar problems when they transferred local database(s) and scripts to another machine?
View Replies !
PHP And DLL Loaded Into MTS: Not Working
I have built a sample dll that just sets string data in the outparameters. I am able to access the DLL functions from PHP and get responses when I use the following call: echo "<b>TestCom Library COM Call</b>"; $TestCom = new COM("TestCom.Server") or die("Unable to instanciate TestCom"); echo "<br/>Loaded TestCom calling Test."; $TestCom->Test($lOut, $lOut1, $lOut2, $lOut3); echo "<br/>Output:$lOut, $lOut1, $lOut2, $lOut3"; Output:teststr, teststr1, teststr2, teststr3 When I host this dll in MTS, The output I recieve is . Output: ,,, When hosted in MTS, I am able to get the same output if I call the dll functions from vbscript/VB. Can anyone help me identify where I am making a mistake, or can anyone give me any pointers?
View Replies !
Htmlentities Is Not Working For Me
>From the php manual I copied and pasted this example: <?php $str = "A 'quote' is <b>bold</b>"; // Outputs: A 'quote' is <b>bold</b> echo htmlentities($str); // Outputs: A 'quote' is <b>bold</b> echo htmlentities($str, ENT_QUOTES); ?> However, when I run it in my browser, the output is wrong: A 'quote' is <b>bold</b>A 'quote' is <b>bold</b> the < is not converted to < (no conversion is taking place) Is there a configuration that would disable htmlentities? Does anyone have any idea as to what would cause htmlentities to not work?
View Replies !
|