| Programming Help | Search | Add Entry |
Programming Coding Help .
|
|
Ive just installed php5 on a new development machine. Apache and MySQL are working and a test of php with a simple phpinfo() works ok. I have transferred my php4 code to the new machine (I didnt expect it to work straight away, but I also didnt expect this error: Parse Error: syntax error, unexpected $end in C:wwwphpSitemodulesuser.php on line 128 It happens on each and every php file with the line number indicated not actually e |
Coding forum FAQ + Bookmarked threads Hey...So I have a function which breaks up a string..I would like to echo just a part of it...but it isnt working...how do I go about doing what I am trying to do here is my code to give you an idea: PHP Code: if($probe->getData() != null){ echo nodeEcho($probe->getData()); } function nodeEcho($str){ $array= split('.',$str,2); return $array[0]; } So each piece of da |
|
Collected solutions to common problems. Salutations to the Forum, Quote: This thread is EXPERIMENTAL. The behaviour of this thread, the title of this thread, the contents of this thread, and this threads very existence may change without notice in future (in fact I hope it will. Except for the last bit. Cant edit something if its deleted). The format is pretty simple. This thread contains links to other threads that discuss the problem in t |
Ive just installed php5 on a new development machine. Apache and MySQL are working and a test of php with a simple phpinfo() works ok. I have transferred my php4 code to the new machine (I didnt expect it to work straight away, but I also didnt expect this error: Parse Error: syntax error, unexpected $end in C:wwwphpSitemodulesuser.php on line 128 It happens on each and every php file with the line number indicated not actually e |
|
I have written a flex application that sends XML to a php script which will then be inserted into a databse. The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working. I have written the post data to a text file and it is coming through. My php file is as follows PHP Code: <?php //Connect to the database $link = mysql_connect(l |
while loop problem, possibly a variable scope issue(?) Hi everyone, I have a slight issue that I have been unable to resolve. Firstly a little explanation, What this function does is pull off results from a table(tenants), specifically using 1 field(tenants_roomnum). It *should* loop through the while statement and build a list of all rooms for the property and if there is a tenant assigned to that property append Room # with occupied. I have narrowed down the problem to the while lo |
|
I have written a flex application that sends XML to a php script which will then be inserted into a databse. The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working. I have written the post data to a text file and it is coming through. My php file is as follows PHP Code: <?php //Connect to the database $link = mysql_connect(localhost, root, |
header too long HTTP_MIME_TOO_LONG I am receiving an error when I call my php file, from an external application: I think that there is some kind of limit in the amount of data that can fit into the header. is there perhaps a header setting or better way, preferably I do not want the data to be returned via the content. Google does not seem to have answers either. <?php session_start(); header("SQL_RESULTS: SQL_RESULTS=$alist"); ?> Thankin |
|
Checking values in an array for an IF statement Im working on some PHP for a Wordpress site im working on. I built some sidebar content that Id like to hide on certain pages. I would need to specify the page ids in an IF statement of some kind. Im sure I could build it with a bunch of || (or) declarations but is there a way to do it nice in an array of some kind? I would put the ids in the array and then create an IF statement that cycled through the array to discover whether the current |
Finding vulnerabilities in code? Hey, I cant figure out why this aint working...I am just trying to pass a php variable (string) into an onchange event...if i replace the variable with just a normal string, it works fine... heres some code: PHP Code: $str = $node->getData(); //(this is the variable that doesnt work) $toReturn = <div style=display:none; id=$nodeID>$space <img src=images/plus.gif onclick=showHide($nodeChild); /> <label |
|
[RESOLVED] CREATE TABLE query doesnt function Hello, In PHP and mysql I am creating a script that adds a new event on the command of the administartor. Everything in the script works fine apart from the create table script. No table is created. I added a die to the end of the query to show the mysql error and to check the table name is correct and this is what I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right |
I am just wondering if anyone out there has a curl script that will log into the comcast website for the account management. This is the only one that i can not figure out as it seems to go through various stages for the log in process that I cannot follow. This is the first part of the script that I am using, it works for everything else, but not for comast.. It then goes in into another post form with a ticketId and then it gets th |
|
PHP Image display from link in DB I am trying to display the image from the link in the database. None of my attempts work (remmed out). I can click to view the image by my hyper link but I am not able to display the image.. Can anyone help out and tell me what syntax I should be using? The link will display like this -> file:///m:/Cop100/25836/109402.cpc PHP Code: <?php $server_choice = $_GET[word]; $username=; $password=; $databa |
i have the following code and i need help in trying to count what is in the value. Here is the code: PHP Code: do { $myhash6[$row_get_Requestedby_Jun[Originator_Submitter]][] = $row_get_Requestedby_Jun[Requested_By]; } while ($row_get_Requestedby_Jun = mysql_fetch_assoc($get_Requestedby_Jun)); arsort ($myhash6); |
|
Hi Guys, Ive been working on a massive chat program for a few months and its just about finished. But Ive come to realize a big flaw. Everything in my program is stored in mysql and the script itself is a php and ajax combo. But here is my problem. There are public rooms and private rooms. Room files are the only thing in my program that are stored in flat files (text files) everything else is in mysql. With some of the features |
[RESOLVED] fopen() -- Resource id #10??? Ive been trying to run fopen() to open a txt file but no matter what I tried over the past hour I always get "Resource id #10" being displayed instead of the contents of the file... Any ideas whats going on? What am I missing or doing wrong? Its very basic code and Ive coded things similar before: PHP Code: $file = fopen(file.txt, r); echo $file; fclose($file); But all I get is: Resource |
|
HELLO! I require some help with my codes. The if query in the following codes does not work. Can anyone help me to identify where i went wrong? THANKYOU! $rthings = mysql_query(SELECT uid,itemid FROM inventory); $things = mysql_fetch_assoc($rthings); if ($_GET["operation"]==1){ $query = UPDATE Person SET wealth = wealth-5 WHERE uid = .$uid; mysql_query($query) or die(mysql_error()); if ($things[uid]==$uid $$ |
HttpRequest returning protected values I am working on loggin into an internal site automatically and performing a search. currently we do this with a perl script so I know it is possible. in order to do this correctly on the system I am working with I need to do the following 1. login to site 2. receive and set a cookie from the system 3. perform search I have logged into the site but when I do I receive the following response. Code: HttpMessage Object |
|
need a PHP Random Unique Number generator I use a conf.inc.php to define some Global variables since I roll out several copies of the same code over and over and need an easy place to edit some basic string variables. My question is if someone knows how to reference a local variable (local to where the Global is called) in the Global variable. simplified example of what works: conf.inc.php file: $GLOBALS[favcolor] = "My favorite color is %s."; Some other php file |
my code isnt working for some reason.. Hey, I cant figure out why this aint working...I am just trying to pass a php variable (string) into an onchange event...if i replace the variable with just a normal string, it works fine... heres some code: PHP Code: $str = $node->getData(); //(this is the variable that doesnt work) $toReturn = <div style=display:none; id=$nodeID>$space <img src=images/plus.gif onclick=showHide($nodeChild); /> <l |
|
[RESOLVED] Save IMAP mailbox attachements Hi, The folloing code login to IMAP/POP3 box and retrieve its contents. Attachements saved to a folder. My problem is the following> if more than 1 attachement exist,its name and content being used for the rest of them. So basically the first overwrite all the following. Is the any idea whats wrong with this script? <?php chmod("/home/user1/public_html/hali/get/store/", 0777); $login = user@domain.net; $ |
Is it possible to run an already established crontab job via a PHP script? Basically, I want the job to be run as called without need for logging into Webmin. Currently, Im running into issues with the script needing to run as root (which is how it is setup in the crontab), but my needing to run the script from the browser (apache). I thought of calling it in the script directly, but I didnt think I could chown from apache to root in the |
|
Contact Form Sending Blank Email Hi, Ive set up a contact form on my website: www.labyrinths-studios.com but every time I submit the information from the email arrives as if the text fields are blank. PHP Code: <?php /* Subject and email variables */ $emailSubject = Contact Form; $webMaster = becky@labyrinth-studios.com; /* Gathering data variables |
[RESOLVED] help with file copy how do i copy a file from one folder to another?? i have tried using this: Code: $file=getpics.php; $dest="archive/$id/"; if (!copy($file, $dest)) { echo "failed to copy $file... "; } and i get this error Code: Warning: copy(archive/197/) [function.copy]: failed to open stream: Permission denied in please help |
|
Im new to PHP and need help understanding what could possibly be the problem with my code. At first, Im just trying to send an email to myself to see that the email function works. But every time the mail() function returns FALSE and echos the failed message. I know the email address is good (Ive replaced my real email here with "myemail@gmail.com"). What can I do to debug this more? Or is there some kind of setup I need to do with |
[RESOLVED] File name of an included file I am editing some old code from another programmer and keep getting data from $GLOBALS[argv]. I have no idea what this is and cant seem to find any info on it other than people are using it. Can anyone tell me where this is set at or what causes a $GLOBALS[argv] variable to be set? Where should I look to find the source? Thanks! |
|
HIi, all of you........ I have site in which i have put a link to download a database table in a excel format. visit this link and download http://genat.com/anesthesia/index.ph...d=54&Itemid=74 My script is working but when i download the file. It displays the data in a single row I want to display each record in a different row. like this 1. NAME PLACE CITY 2. NAME PLACE CITY 3. NAME PLACE CITY anybody pl |
I have written a flex application that sends XML to a php script which will then be inserted into a databse. The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working. I have written the post data to a text file and it is coming through. My php file is as follows PHP Code: <?php //Connect to the database $link = mysql_conn |
|
Hello, So Im trying to have a checkbox removed on submit if its checked. This probably needs to be done with javascript, but I thought Id see what other people thought here first. First, I have an xml file that is structured like so: HTML Code: <root> <child1></child1> <child2></child2> <child3> <item1></item1> <item2></item2> </child3> </root> |
| Powered by Sigsiu.NET | ![]() |