Search found 236 matches

by minimihi
Tue May 01, 2012 12:41 pm
Forum: PHP coding => General
Topic: $request_url problem
Replies: 13
Views: 1881

Re: $request_url problem

Ah... sorry.

This is why I don't like to set and compare inside if statement. I missed brackets.

Change

Code: Select all

if($position = strpos($request_uri, '?') !== FALSE) { 
to

Code: Select all

if(($position = strpos($request_uri, '?')) !== FALSE) { 
by minimihi
Tue May 01, 2012 10:55 am
Forum: Free time
Topic: New Free FPS - Tribes
Replies: 5
Views: 4200

Re: New Free FPS - Tribes

I downloaded installer, but I'm scared to install it.
I know that starting a new game won't end well form me.
by minimihi
Tue May 01, 2012 10:52 am
Forum: PHP General
Topic: PHP and the Internet
Replies: 4
Views: 1188

Re: PHP and the Internet

At least answer is much more accurate than a question
by minimihi
Tue May 01, 2012 10:36 am
Forum: PHP coding => General
Topic: $request_url problem
Replies: 13
Views: 1881

Re: $request_url problem

Your general idea would work. As for this code - it wouldn't. Function strpos() returns integer (a number) indicating position of symbol in string , if it finds a symbol. So that if condition would be bad. Also also else statement looks out of place :? <?php $request_uri = $_SERVER['REQUEST_URI']; i...
by minimihi
Tue May 01, 2012 10:09 am
Forum: mySQL & php coding
Topic: Add/Delete Multiple Items from One PHP Form
Replies: 1
Views: 779

Re: Add/Delete Multiple Items from One PHP Form

Now you're talking about creating user interface. You could created a div block which would act as a button. Button could look like ON | OFF switch. When adding ADD would turn green (DELETE would stay grey), on deleting DELETE would turn red (ADD would stay grey). With a little more effect that woul...
by minimihi
Tue May 01, 2012 7:08 am
Forum: PHP coding => General
Topic: $request_url problem
Replies: 13
Views: 1881

Re: $request_url problem

As long as you had something to figure out yourself - is good
by minimihi
Tue May 01, 2012 6:31 am
Forum: PHP coding => General
Topic: $request_url problem
Replies: 13
Views: 1881

Re: $request_url problem

That did not work for me. Not my fault if you don't know how to adapt it to your code. Your problem probably is that strpos() would return FALSE when it doesn't find '?' in $request_uri . In this case substr() would look like this substr ( 'folder1/folder2/' , 0 , false ); which would return empty ...
by minimihi
Tue May 01, 2012 5:38 am
Forum: mySQL & php coding
Topic: Add/Delete Multiple Items from One PHP Form
Replies: 1
Views: 779

Re: Add/Delete Multiple Items from One PHP Form

You can realize it by biding onchange event handler to checkbox (with JavaScript ). When checkbox is changed, you generated information about a change. That information would be set to PHP file (using AJAX method). Inside PHP file you would receive that information, use it to determine what action t...
by minimihi
Tue May 01, 2012 4:36 am
Forum: PHP coding => General
Topic: Unable to sort array, and array keys don't increment
Replies: 0
Views: 489

Re: Unable to sort array, and array keys don't increment

First thing, you need to scope your second and last loops with brackets. Else loop will be applied only to first function after loop condition. Brackets around foreach are useless. Also you didn't take into consideration, that fgets() reads line by line. So during first loop it takes first line from...
by minimihi
Tue May 01, 2012 3:51 am
Forum: PHP coding => General
Topic: Click name from one mysql table to show report on other pag
Replies: 2
Views: 582

Re: Click name from one mysql table to show report on other

In second code you have to select rows from database with information you passed in id. In your case query could look like that: SELECT * FROM students WHERE name = $studetId Also, you should use $_GET instead of $_POST . Since you're passing id using GET method. P.S. It is weird that you pass name ...
by minimihi
Tue May 01, 2012 3:09 am
Forum: mySQL & php coding
Topic: How to connect one form to two db
Replies: 4
Views: 923

Re: How to connect one form to two db

It seem you didn't even read what I wrote. Only copied parts of code and hoped for it to work. See what this code does, inspect it and adapt to your code whatever you have learned from it. <?php $con = mysql_connect("localhost","root","");     if (!$con) {     die('Could not connect: ' . mysql_error...
by minimihi
Tue May 01, 2012 2:39 am
Forum: PHP coding => General
Topic: $request_url problem
Replies: 13
Views: 1881

Re: $request_url problem

You need only part before '?' , without domain name and filename. One way to do that is to to use $_SERVER [ 'REQUEST_URI' ] returned value and extract everything before '?' . That could be done like this: $request_uri = $_SERVER['REQUEST_URI']; // find position of '?' in a string $position = strpos...
by minimihi
Tue May 01, 2012 2:21 am
Forum: PHP coding => General
Topic: htmlspecialchars_decode
Replies: 0
Views: 369

Re: htmlspecialchars_decode

Just don't use htmlspecialchars_decode()
Just print whatever you're getting.
Browser will recognize all those special codes for symbols and print them accordingly as a text.
by minimihi
Mon Apr 30, 2012 11:50 am
Forum: mySQL & php coding
Topic: Passing Sessions
Replies: 5
Views: 1020

Re: Passing Sessions

Now take a look at those pages and tell me. Where do you see PHP SCRIPT? :-x THIS IS PHP forum , THIS IS probably PHP PROBLEM and THAT ISN'T PHP SOURCE CODE I checked what data is passed between the pages and didn't see anything what would indicated what order is updated when passing data from updat...
by minimihi
Mon Apr 30, 2012 7:57 am
Forum: mySQL & php coding
Topic: How to connect one form to two db
Replies: 4
Views: 923

Re: How to connect one form to two db

If you want to connect to different databases on same server with different accounts. You can do it like this $db1 = mysql_connect($server, $db_username, $db_password); $db2 = mysql_connect($server, $db_username2, $db_password2); mysql_select_db('calendar', $db1); mysql_select_db('college', $db2); ...
by minimihi
Mon Apr 30, 2012 6:46 am
Forum: PHP coding => General
Topic: Trouble with passing php parameters without using a form
Replies: 0
Views: 554

Re: Trouble with passing php parameters without using a form

It's returning undefined index errors, because you're trying to print columns which weren't selected in query. These all of these don't exist: $line1['course_id'] $line1['course_name'] $line1['semester'] $line1['year'] $line1['course_description'] $line1['SGoal_Description'] $line1['sobjective_descr...
by minimihi
Mon Apr 30, 2012 3:19 am
Forum: mySQL & php coding
Topic: Passing Sessions
Replies: 5
Views: 1020

Re: Passing Sessions

How are you passing item ID from second form to form submission?
by minimihi
Mon Apr 30, 2012 3:11 am
Forum: PHP coding => General
Topic: Eventbrite user data
Replies: 5
Views: 860

Re: Eventbrite user data

And how are you trying to use it?
by minimihi
Sun Apr 29, 2012 2:11 pm
Forum: PHP General
Topic: Echo?
Replies: 0
Views: 545

Re: Echo?

A way you're asking is seriously weird.

Echo can contain a variable, constant, function, object... anything else (?). All those things contains/returns some kind of value.
So, echo is actually printing a value :? It prints not a var/con/fcn/obj itself, but it's content.

Reference:
echo
by minimihi
Sun Apr 29, 2012 1:42 pm
Forum: mySQL & php coding
Topic: unexpected T_IS_EQUAL, expecting T_VARIABLE or '$'
Replies: 3
Views: 1472

Re: unexpected T_IS_EQUAL, expecting T_VARIABLE or '$'

And why the hell I missed that

Code: Select all

$input = $_GET ("input"); 
Variable $_GET is array. So it should be

Code: Select all

$input = $_GET ["input"]; 
also

Code: Select all

if ($==1) 
see what are you comparing here
by minimihi
Sun Apr 29, 2012 10:12 am
Forum: PHP coding => General
Topic: need php class for database queries
Replies: 1
Views: 595

Re: need php class for database queries

There are classes who are handling some features, but you still would end up writing query sentence yourself :D
by minimihi
Sun Apr 29, 2012 10:05 am
Forum: PHP coding => General
Topic: Multiple Chat System like im.imo
Replies: 0
Views: 576

Re: Multiple Chat System like im.imo

God killed a kitten
by minimihi
Sun Apr 29, 2012 9:56 am
Forum: mySQL & php coding
Topic: How do i set selected item in a dropdown PHP MySQL
Replies: 0
Views: 591

Re: How do i set selected item in a dropdown PHP MySQL

With each while loop you receive one row to $rowBus (with each loop variable is overwritten with new value), so there is no need to use foreach loop. In foreach loop you're taking current row index to $key and value to $value . Then compare current row 'bus_id' value to $value variable, which always...
by minimihi
Sun Apr 29, 2012 9:36 am
Forum: mySQL & php coding
Topic: Passing Sessions
Replies: 5
Views: 1020

Re: Passing Sessions

<form id="FormName" action="updated.php?id=id" method="post" name="FormName">

Care to check this out? :?
by minimihi
Sun Apr 29, 2012 9:32 am
Forum: mySQL & php coding
Topic: unexpected T_IS_EQUAL, expecting T_VARIABLE or '$'
Replies: 3
Views: 1472

Re: unexpected T_IS_EQUAL, expecting T_VARIABLE or '$'

'each' in query should be variable, not a string
Also, you're missing WHERE statement in your query