Jump to content

Recommended Posts

I just need it a simple php/mysql code that i can put at the top of the page..

 

It has to be like

 

It has to check if uStreet ,uApt ,uCity ,uState ,uZip are empty in the mysql database and if it is it redirect to info.php but if not it continues with the script..

 

Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/153816-can-someone-help-me-with-a-redirect/
Share on other sites

Well considering we can't see the code it is hard to help.

But after you check the data you can add:

 

header("Location: info.php");

 

 

You can add an else statement aftwards if you want it to do something else if their is information.

Okay.. I need a way to check if these tables are not empty in the mysql database.

 

uStreet ,uApt ,uCity ,uState ,uZip

 

If they are then the user gets redirect to info.php  But if they are not empty then they dont get redirected and the script can finished.

 

So something like select from blah blah if empty redirect }else{ script finishes.

Well.. If you want to take a look at my code then be my guess.

 

I still don't understand how i can just check those 5 columns.

<?php

$query = "SELECT count(*) FROM pbs_users
WHERE uEmail='".$userInfo[$TbUsers->col_uEmail]."'"); 
$result = mysql_query($query) or die(mysql_error());

if(empty){ 
header("Location: info.php");
}

}else{
header("Location: index.php");
}


Well instead of slecting everything by using (*) add just the row names you need.

COUNT rowname,rowname,rowname etc.

 

Also you should change the way you are checking if they are empty.

 

$query = "SELECT count(*) FROM pbs_users
WHERE uEmail='".$userInfo[$TbUsers->col_uEmail]."'"); 
$result = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($result)==0) ;
header("Location: info.php");
}

}else{
header("Location: index.php");
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.