Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

$_server['php-self']

Featured Replies

I have a form.

Users choose options from this form and the values are submitted to a PHP file.

The PHP file takes the users values and performs a customized SQL Query.

The results are split so that only 5 results show per page, with links at the bottom to "next" and "previous" results pages.

I'm using $_server['php-self'] to re-submit the query when the user clicks "next" or "previous".

 

But the users values from the original form, seem to be forgotten and the new query fails (to show page 2's results) because it no longer has user input.

 

Still with me? (sorry for any bad explanation)

 

How do I pass the users values again so that the PHP can keep performing the query?

 

Thanks,

Jarrad

You have 2 options:

 

- store user preferences in a session variable(s);

- pass the values along the url as parameters; (URL?param1=this&param2=that&param3=etc)

 

Either way before you render the page you have to read those values and build the pagination links accordingly.

You have 2 options:

 

- store user preferences in a session variable(s);

- pass the values along the url as parameters; (URL?param1=this&param2=that&param3=etc)

 

Either way before you render the page you have to read those values and build the pagination links accordingly.

Thats what I was going to say...lucky I refreshed the tab before I posted.

  • Author

Thanks for replies. I'm learning about session variables now, but I'm having a bit of trouble.

 

Is there an alternative to include 'file.ext';? (not require)

 

I have a parent php file that compiles an SQL Query based on user-input, and at the end of it I use include 'file.ext'; to link to the child php file that displays the querys results.

 

The problem being, that the child php file that displays results, calls on itself. This, of course, re-runs the parent php file as well and empties all my variables that were originally set from a FORM POST... :/

 

I need to be able to execute the parent php file once only, and have the include''; child php file call on itself without re-running the parent code.

 

Thanks for any replies,

 

Jarrad

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.