What's Wrong With This Code?
I keep getting parse errors on line 10 (the "if (isset($LOGINID)) {" line). Can any of you figure out why the hell I keep getting this? Is is just something simple I'm overlooking? And if you have any comments on my code (security, structure, tips, etc), I'd like to know as well...
[edit] Oh yeah, the db_connect, db_array, db_query, and decrypt functions are all defined in database.php and crypt.php. PHP Code:
View Complete Forum Thread with Replies
Related Forum Messages:
4 XML: Whats Wrong With This?
All i need is someone to help me with my script so that every node in the array goes through the if..else.. statments, with the end result of an array of $albums and an array of $images. Code:
View Replies !
Whats Wrong With Magic_quotes_gpc?
People say magic_quotes_gpc should be turned off in php.ini but I dont see the problem?! $name = "O'reilly"; Would be O'reilly - therefore saving the extra line of code to addslashes. So why should it be turned off?
View Replies !
Can Someone Tell Me Whats Wrong With This Script?
When i submit form to this i get: Warning: fread(): Length parameter must be greater than 0. in /home/jabbic/public_html/Jamies Cookies And PHP :P/post.php on line 4 Warning: fopen(djsays.txt): failed to open stream: Permission denied in /home/jabbic/public_html/Jamies Cookies And PHP :P/post.php on line 10 Couldn't open djsays.txt Code:
View Replies !
Whats Wrong With This Security Script?
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40). (the included config is just server settings, the login is just a login form). The script appear to connect but will not redirect users, it seems that even with correct login details, it won't validate. this code is in top of each protected page granting access to users with user level 10: <?php $allow = array (10);include ("../protect/protect.php"); ?> THE SCRIPT (protect.php):......
View Replies !
Whats Wrong With My Mail Function?
I have a form in which a user subscribes to a mailing list, and it sends out an email to the admin saying this user wishes to subscribe to a mailing list. this code was working at one time, and now it doesnt. I was the one who originally wrote it, and to my knowledge no one has touched it. PHP Code:
View Replies !
Ora_parse Error - Whats Wrong?
this one's had me stumped! $conn=ora_logon("cricketunes@pickles","j8j3kf"); if ($conn != TRUE) die("Unable to connect to oracle, exiting... "); $cursor = ora_open($conn); if ($cursor != TRUE) die("Unable to open a cursor, exiting... "); $result = ora_parse($cursor,$query); if ($result != TRUE) die("Unable to parse SQL block<BR>"); Warning: Ora_Parse failed (ORA-00911: invalid character -- while processing OCI function OPARSE) in add.php on line 33 What is wrong with my ora_parse function call?
View Replies !
Printing Out An Associative Array - Whats Wrong?
I have this code segment: $query = "Select * from Payments order by CustID"; .. .. /* execute the query */ .. if (ora_exec($cursor)) { $recordset=array(); while (ora_fetch_into($cursor,$recordset,ORA_FETCHINTO_N ULLS| ORA_FETCHINTO_ASSOC)) { echo $recordset["CustID"]."<BR>"; echo $recordset["Amount"]."<BR>"; } } Gives me the following error Notice: Undefined index: CustID Notice: Undefined index: Amount The table Payments has only CustID and Amount as attributes. is my usage of the array offset incorrect?
View Replies !
What's Wrong In This Code
$link = mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD); $selectStmt = "SELECT * FROM user_profile WHERE userid = 'david'"; if (!($result = mysql_db_query($DB, $selectStmt, $link))){ header("Location:http://$HTTP_HOST/$DOCROOT/error.html"); exit(); } here is the case, the userid 'David' is NOT in the table 'user_profile', the program should launch the error.html, and exit(), But it is not.
View Replies !
What's Wrong With This Php Code?
I put the following php code inside my index.html page. I upload it to my host server (free.prohosting.com), change the extension to php (and another one with php3)and CHMOD it to 644. When i viewed it in a browser, the normal html appeared but the items inside the php code failed to appear. Can somebody help me to confirm whether there is something wrong with my php code (it is a news grabber code) or is it because my webhost don't support php (the unofficial FAQ says that the server support php). If there is something wrong with my php code, here is the code: PHP code:
View Replies !
What Is Wrong With This Code?
I am trying to setup a set of radio buttons from a table. I am getting the error: Parse error: parse error, unexpected '[', expecting ',' or '' in /var/www/html/liberty/prototype1.php on line 251 This is the snippet of code. <?php $getnormwtA = getnormwt(); $numct = count($getnormwtA); $tab = 16; $wt = 'weight' $typ = 'radio' for ($i=0; $i<$numct; $i++){ echo "<input name=". $wt ." tabindex=". $tab ." value=". $getnormwtA[$i]['bodywtid'] ." type=". $typ ."/>". getnormwtA[$i]['bodyweightnorm'] .">"; $tab++; ?>} ?> This is line 251 echo "<input name=". $wt ." tabindex=". $tab ." value=". $getnormwtA[$i]['bodywtid'] ." type=". $typ ."/>". getnormwtA[$i]['bodyweightnorm'] .">";
View Replies !
What Is Wrong With This Piece Of Code
I am using a piece of code which is testing if a certain variable is <=0. and the code is written as follows: $lc_align = 'center' if ($listing['products_quantity']<=0) { $lc_text = tep_image_button('button_buy_now_na.gif', IMAGE_BUTTON_BUY_NOW_NA) . ' ' } else { $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' } break; } The problem I am facing is that the this code returns all result to be true ie. <=0 even though most of the variable are greater than 1. Is the test wrong? Or can I change the syntax and how do I do that
View Replies !
What's Wrong With This Mail Code?
$mailto = $email; $xHeaders = "From: myname@mydomain.com"; $subject="Subject"; $text = "Some message."; mail($mailto, $subject, $text, $xHeaders); I can get this email to one of my mailboxes but not another (strangely, the email address of the host from which I'm sending it). Do I need separate headers for the "to" and "from" or something?
View Replies !
Script Error Message Is Referencing Wrong Line Of Code
Im developing php pages under apache and Mac OS X. When I have a scripting error, the error page says... ....error occurred at line 139 Problem is that line 139 is blank and the bad code is really on line 142. Its usaully off by random numbers so I cant just add/subtract a couple of numbers to guess the real line of problem code. This is a pain and is slowing me up for trouble-shooting scripts. Any suggestions? Is this a php.ini setting? -
View Replies !
Whats The Best Way To Do This.
I read about 10K rows from mysql (just char field) and i need to divide them on about 10 select menus.. and they will be hidden and only one will be displayed upon user choice of other select menu. so someone has helped me with the hide/show in javascript section, but i dono how to put them in select menu in a fast way for loading. is it possible to built 10 different select menu in for loop where am reading from mysql and i check my condition to fill the corresponding select menu? i cant c its possible unless by having new 10s select menu each time it loops... the thing is that i dont wana read the 10K rows each time to build each select menu.. any clue?
View Replies !
Whats The Best Way To Do This?
I currently have a website that uses an option drop down box to select different colours for an item before the form it is in is submitted. This works fine but as I am trying to advance my skills I decided to learn PHP to use with SQL which I already know. I have yet to start but am thinking of how to go about it and looking at some example code. The whole thing looks easier enough but I was wondering how these option boxs would fit into it. I'm thinking one way to possibly do it would be an array with all the options in. However, would it be possible to have what should be the contents of the array as part of the table? For eg something like: Colours ----------- Blue,black,green And also would it be possible using these to change the price of an item? That isn't so important now but may be useful in the future, although I can make it work another way if need be.
View Replies !
Whats The Deal With IIS?
When I develop my applications, I use Apache, and everything works great. I can set cookies, use variables great and so on. BUT, my server is using IIS and it is ruining my world: I can't set cookies!! I hate it. I got it to work by changing a piece of code from a header redirection to a header refresh BUT the only expiration time that works is the number 0. So the users of my app, can just close the goddamn window and vote again(or whatever).
View Replies !
Post And Get, Whats The Difference?
I just want to know the difference between the post and get method of a form...when do i use post or get...like when im creating an application/membership form. does the two methods have different impacts on the script triggered by the submit button.
View Replies !
Regexp - Get Whats Between The <td></td> Tags.
I am having trouble with the following. I'm not getting any error and I have exhausted everything I can think of so any help would be appreciated. I am trying to get whats between the <td></td> tags. It needs to start at the HP because it is just a segment of a larger string. Itried a bunch of different combinations but the following 2 didnt return any errors, just not the data I want. <td>HP</td><td>2132</td><td>210</td><td>99</td><td>2441</td> preg_match_all("/HP(<[.+]>)+([d+])</[.+]>/si",$file,$matches); preg_match_all("/HP(</?[.+]>)+([d+])</?[.+]>/si",$file,$matches);
View Replies !
Whats The Deal With Functions
I am trying to call a function which I have declared in another PHP file which I have included in my main script. but when I run the script I get a fatal error. I don't get it, can't you declare function in a seperate include file and use the include or require statment to include it in the current php file?. PHP Code:
View Replies !
Whats Really Faster, PHP (as Module) Or CGI?
There is alot of debate that I see over what the fastest script is among certain people who really don't know much. So for a script that displays no content, just some MySQL work, some calculations, and some headers, what is faster: a PHP script run as Apache module, or a CGI written in C or C++???
View Replies !
Whats Changed Since PHP Persion 4.3.10?
I've not coded php for a couple of years now and, for some reason, I decided to refresh my memory. I opened an old script I had been playing with back then and started editing, and testing on my local machine. I have Apache, PHP Version 4.3.10 and MySQL installed on my machine which I have had installed for what must be two and a half years. When I test locally, the site (what there is of it) works perfectly, correct includes are called, menus expanded and menu items highlighted when chosen. When I upload it to my host (which is apache based and supports both PHP4 and 5 (PHP Version 4.4.7 installed)), the initial page is correct, but when I click on any menu item, includes aren't called, selected menu items aren't highlighted or expanded.
View Replies !
Whats The Point In Session Id?
Whats it really used for? session_id(); ?? // I know its about the current session id, which is like some weird hash PHPSESSID // same thing.. why do you need these two things? I just don't get it!
View Replies !
Whats The Mimetype Of .xls In File??
is this correct ? ($_FILES['sql_file']['type'] == 'application/xls.ms-excel') i need to upload a file in xls format excel type and determine its type before uploading and i dont know the type to be used whats the mimetpye of .xls in file??
View Replies !
Sorting Data - Whats The Best Way?
I have a number of members stored in my database, and i would like to create a page to allow people to browse through the members and see certian bits of information. I would like this page to be dynamically ordered (sorted) by the date the information was last updated, thereby keeping the most up to date information at the front, and penalising those that dont update often. I am thinking of simply adding a field in my database, and inserting a gregorian timestamp (based on the servers current date) everytime a member updates the info. Firstly, is this the best way of keeping track of updates ? And, how would i go about ordering my data by this particular data?..... does php have an "order by" function?
View Replies !
Whats The Deal With Register Globals??
Ok, in all the time I've been here I see register globals problems coming up all the time. I've never had a problem with this yet, so could someone explain (in simple format) what this is all about, and why so many people have a problem with it?
View Replies !
Whats A Good Way To Write GUI Apps
I need to write a couple of small GUI applications but have never done so on Linux (I'm a C/Delphi programmer on Windows normally) I'm fairly conversant with linux but have never written any code for it. I know this tends to be subjective and I dont want a flame war but can anyone suggest the best language to learn to do this with?
View Replies !
Navlink Count - Whats The Best Method
I'm writing a guestbook and given the number of entrys the guestbook might have can vary quite a lot - the nav links to view the guestbook entrys need to generated live at the time to suit . Whats a good method to get the effect .
View Replies !
Whats The Cross Domain Cookies
Any one say how to set a cross domain cookies. for example my site is <a target="_blank" rel=nofollow href="http://www.damu.com">[link]</a> i set one cookie in this site but i want to use the same cookie in another site: best example : if i login gmail using my login user name and password .then same browser new tab i open orkut.com its login automatically. using my...
View Replies !
Whats The Best Way To Handle The Upload Images
What im trying to do is make a form with the usual username,password, and email fields but at the bottom before the form is submitted there is an option to upload a photo, i have made the code this: <input name="userfile" type="file" size="50" /> theres no upload button as the main button at the bottom of the form is meant to pass all the fields including the upload file one, but im not sure whats the best way to handle the upload, i put the "userfile" into variable on the submitted page but should that go into the MySQL database (the photo i mean) or is there another way to do this.
View Replies !
Constructing An LDAP Query - Whats In The URL?
I have a nice little php script to query my LDAP/AD and perform a search. I now want to pass on the search variable of 'q' to a AJAX live search. I'm almost there I just need to know what the query in the URL is. For example when we use google the basic search query is google.com?=Yoursearchterm so what is the URL actually sending for and LDAP/AD search? This is my script .....
View Replies !
Restricting Whats Displayed By Amount
I have a events calendar, that alows guest users to add their attendence, but what I want to do is not show the add attendee button once the amount of attendees reaches the amount of spaces on the course. What would be the best way to do this. The add attendee function is added to the page in an include.
View Replies !
Whats The Quickest Way To Extract Data From String?
As I have screwed my mod rewrite (!) I need to extract some information from the url. www.mydomain.com/widgets_blue/type_001/id_#*$!x www.mydomain.com/widgets_red/type_003/id_xxxx www.mydomain.com/widgets_yellow/type_002/id_xxxx "$id = $HTTP_GET_VARS['id'];" doesn't work for some reason if the url doesn't have a slash at the end... www.mydomain.com/widgets_yellow/type_002/id_xxxx/ (If the slash is there, then it works fine?) So I need to quickly extract the value of id (in the above examples 'xxxx'). Whats the best way of doing this? I was thinking about moving it into an array and reading backwards(?).
View Replies !
Whats The Best Way Of Making A Livepage? (refreshing Page Data)
So I am trying to make a kind of Livepage/chatroom thing where people can comment in a chatroom-type interface... (kinda like IRC) I am doing it in PHP and saving all the messages into a MySQL table.. the table will empty at the end of each day or two or whatever to save space.. So when a user enters a messages and hits submit, it will save it to the MySQL database and refresh the page... But what about incoming messages? What, in your opinion, is the fastest and most seamless way of getting the new info from the database, or am I going about this all wrong?
View Replies !
Whats PHPs Version Of ASPs Application Scope Variable
In ASP you can create a variable that is accessible by all scripts in an application. Is this possible in PHP? Storing a multi-dimensional array in memory has much greater performance benefits than storing in a database or session (which just gets saved to disk anyway). Id like to have my commonly used application variables in memory. Is this possible or is it one of the few flaws of PHP?
View Replies !
What's Wrong W/this (if / Or) ?
When ppmode is set to "cancel" or "thankyou", the header and exit are still processed. I'm trying to search on "if" and "or" in google, but it keeps removing "or" from my searches. Is there something wrong w/this ? if (($ppmode != "cancel") or ($ppmode != "thankyou")) { header("Location: index.php"); exit(); }
View Replies !
Wrong Id
I have a table named 'choose' with the fields site_id, user_id and values, with 2 rows : row1 : site_id = 1 user_id = 2 value = 0 row2 : site_id = 4 user_id = 2 value = 0 I use the following form, that get's it's info from another table Code:
View Replies !
|