Forum

Posts

RECENTLY INDEXED PROGRAMMING SOLUTIONS OF PHP


"\n" not recognized :(  

So, i have a text file called quetsionsFile.txt containing 100 lines with each line formatted like this:Question*1st choice*2nd choice*3rd choice*(value of correct choice: 1,2 or 3)Here's a screen capture for the dummy file i'm working with:URL Continue Reading
Views : 351
Wednesday 24th of October 2012

passing variables in link var=x and displaying contens from db  

Could someone help me with a problem I am having. I don't know how to do what I want after a link has been selected. Please view code: PHP Code: Continue Reading
Views : 130
Wednesday 24th of October 2012

Maximum word length.  

Hey there,I have a variable of $username that I want to only allow 8 characters/letters to print out with three ... after iy.For example:$username = "DefinedHost";would print out:DefinedH...I've tried... Continue Reading
Views : 196
Wednesday 24th of October 2012

Building your own serverside scripting language  

This is more a curiosity question but how does someone get started? And I dont just mean serverside scripting languages but programming languages in general. I have tried to find more information on the web but what I could find was very limited.How do you for example start... Continue Reading
Views : 128
Wednesday 24th of October 2012

rotating images with GD and imagerotate()  

I've been hacking at my image rotation function for days now and I can't get it to work. I've tried almost every example from the manual page about imagerotate(), but no luck. I'm getting desperate, so I'm turning to you guys. Could somebody please help me out? Continue Reading
Views : 208
Wednesday 24th of October 2012

php - variables in url  

I'm not a newbie in php and I was wondering how I can make a page in my site to look like this http://mysite.com?page1I know how to do on this way, http:/mysite.com?page=1.Can someone help me out how... Continue Reading
Views : 186
Wednesday 24th of October 2012

array problem  

I tried to compare the vaule between 2 tables and display and highlight the result in multiple list box. $query2 = "select code_name,code_desc from CTY_FRAUD_LOOKUP";$result2 = mysql_query($query2);while($row = mysql_fetch_array($result2)) { echo... Continue Reading
Views : 176
Wednesday 24th of October 2012

Beginner: need help with MySQL query frustration  

i'm new to php, working on school project(they don't teach php, but i have to use it to develop my project). i have a problem.i have a mysql table with an auto-incremental ID field. my query searches for an Advisor's name, and if found, assigns the PHP variable, $advisor_ID,... Continue Reading
Views : 141
Wednesday 24th of October 2012

DropDown boxes autopopulate  

i know there are threads about how to do this on this forum but i have a little twist to the problem: i have 2 combo boxes, both being populated from oracle (sql) databases, already being populated, so i got the sql part working, now i want the second box to populate only when a selection... Continue Reading
Views : 209
Wednesday 24th of October 2012

upload script  

hi. i'm trying to create a page that holds results from track meets. an ex of someone else's site is:http://www.flashresults.com/flashwe...XC/schedule.htm i... Continue Reading
Views : 190
Wednesday 24th of October 2012

Register Globals Error  

Well my hosts server has been updated and the feature of register globals() was turned off. To make a long story short after going through a 2 hour phone call with my host he concluded that my php code ( ) was no longed up to date and I needed to retool my php... Continue Reading
Views : 160
Wednesday 24th of October 2012

freeze pane effect in html/php  

is there any method to write in html for freeze pane like in excel where i can scroll vertically and the heading(the first row) still remain static and the rest of the row will scroll down so that user can know which field they are looking at when the table are very long vertically??? Continue Reading
Views : 181
Wednesday 24th of October 2012

norton's internet protect blocks images  

I have now noticed something happening on my site and others claim the same thing. If someone has Norton's Internet Protect enabled it is blocking my images. But it is very selective of which images.I don't believe this is a PHP problem but I'm posting here because I code 100%... Continue Reading
Views : 190
Wednesday 24th of October 2012

Timeout whislt populating database  

HeyI am trying to populate a new database, with different field names, with an old databse.As this is a once off i threw together this little script to help me out: PHP... Continue Reading
Views : 190
Wednesday 24th of October 2012

Remove text from within 2 phrases  

Hi, im trying to remove the first line in a variable. I have been using str_replace command but im finding that the text im matching it with can slightly differ and therefor doesnt work.the line im removing looks like this: Continue Reading
Views : 210
Wednesday 24th of October 2012

"global" session for all users  

I'm working on a multilingual site. All texts in all languages are saved in a database. This means that for each page a user enters the database must be accessed to fetch the texts for the page. This is choking the database.So what I need, ideally, is to put all the text from... Continue Reading
Views : 193
Wednesday 24th of October 2012

MySQL and PHP - Query Help  

I am trying to sort all people by handicap and I am looking for help and suggestions...I have 3 tables that are related to my question league members ID / ... Continue Reading
Views : 171
Wednesday 24th of October 2012

removing element from array  

May Array is:$sortorder = "Browser";$allowed_order = array ('Hostname', 'Page','Date','Browser','Referer','Timestamp');I want to be able to remove any of the array elements based on whatever $sortorder is at the time.I tried:unset($allowed_order,... Continue Reading
Views : 198
Wednesday 24th of October 2012

Display session_id in address bar  

Hi,Anyone knows how to display the current session_id() in the address bar.Here's my bit of code that doesn't work: PHP Code: Continue Reading
Views : 219
Wednesday 24th of October 2012

how 2 reload a page  

I have made a form...which processes itself (i.e. $PHP_SELF)If the user makes an error it is reported on the same pageand the previous values in the text fields of the form are echoed(in the same text field)...normally the reset button handles all the work... but since I... Continue Reading
Views : 227
Wednesday 24th of October 2012

get the file contain and assign to a variable  

Hi Can any one tell me how to write the file contained for a directory and write it to a variable.The following is my code:1. a txt file contains 0 to 10 (/var/www/htdocs/xfile/ses/copy.txt")2. $fp1 =... Continue Reading
Views : 178
Wednesday 24th of October 2012

Push file downloads  

I have trawled this forum for information on forcing a file download and I finally have code that works. However, I am still faced with a problem. As I am using sessions throughout my site I have to open a blank browser window as I need to modify the headers to force the file download. So... Continue Reading
Views : 178
Wednesday 24th of October 2012

Submitting Blanks  

Hi,I'm not sure what is causing the problem, so I'm submitting here.Is there anything wrong with my code?: PHP Code: Continue Reading
Views : 172
Wednesday 24th of October 2012

Optimizing Echo Statements  

I know the way that i am currently doing this is like the most horrible way... but I don't know how else to do it without compeltely redoing the site and using templates. And even though I am not sure if I'd be able to do it (or if I could even figure that out.)So... Continue Reading
Views : 158
Wednesday 24th of October 2012

header("Location: ") sometimes works, sometimes doesn't  

Hey,this is like my fifth post in 24 hours with a question, lol. Um, okay, I have different scripts that check for stuff, and if it's true, then it redirects you to a different page user header("Location: "); well this works sometimes, and other times it doesn't, here is an... Continue Reading
Views : 125
Wednesday 24th of October 2012

simple math question  

i know its possible, but im confused as to how. im fairly new with php. what im doing is i do a do while statment to show pictures in a given directory. theyre in a table. what i want is ever 4 pictures for the while statement to also execute a Table Break everytime the 4... Continue Reading
Views : 218
Wednesday 24th of October 2012

users upload into a directory which is their username  

i have a system that creates a directory for each user that signs up..i also have a script to upload files...now...how do i set it so that it uploads to their directory... Continue Reading
Views : 112
Wednesday 24th of October 2012

session register all form fields  

Hi,I have a long form that echo's a whole lot of selections back to the user I would like to change it to a multi page form If I use sessions to store the form results how would I turn all the form variables into session variables without having to declare each individually?Then... Continue Reading
Views : 213
Wednesday 24th of October 2012

PHP and random files  

is it possible and how?I have a basic text file with about 5,000 lines, one address on each line, is it possible to take the text file, and rewrite it in a random order fashion?for example here's the file:address1address2address3then... Continue Reading
Views : 187
Wednesday 24th of October 2012

PHP Sessions Conditional Starting  

Hiya experts! I am using PHP sessions on parts of my site to authorise access to certain pages.I only want PHP sessions to be started when either a user attempts to login, or is already login and needs to maintain the session data (ie: for the rest of there site... Continue Reading
Views : 147
Wednesday 24th of October 2012